Retrieve a scalar valued function result

Topics: Data Access Application Block
Nov 12, 2008 at 6:07 PM
Hi,

I did not find in the documentation how to call a scalar valued function and retrieve the returned value.
My example is a SV Function returning a BIT value.

I tried ExecuteScalar() but it seems that it is only used to retrieve the first column in the first row of a SP result.

Did I miss something?
Nov 12, 2008 at 7:03 PM
For the answer see the following post (MGNoonan answer)
http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=7119

Basically you have to use a "SELECT @result=Function();" SQL text command, run it with ExecuteNonQuery() and finally get the result using GetParameterValue().

Thank you M.