How can I run a scalar valued function from c# and get its value? For a table-based function, I use a select command and get the resulting DataTable, but I am clueless on how to do it with scalar valued functions.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can pass a string to SQL and have it do anything that SQL can do using
SqlConnecitonand ‘SqlCommand’.You can use ExecuteScalar or one of the other execution methods. http://msdn.microsoft.com/en-us/library/182ax5k8.aspx
You can make your SQL string do any SQL, and return/not return using the different execution methods.