Retrieve a scalar valued function result

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

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 8:03 PM
For the answer see the following post (MGNoonan answer)

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.