hey all,
is it possible to call a sql server scalar function from c#?
thanks,
rodchar
Jeroen Mostert - 21 Mar 2008 20:21 GMT
> hey all,
> is it possible to call a sql server scalar function from c#?
Yes, but not directly. You'll have to use a statement of the form "SELECT
dbo.FunctionName(@Param1, @Param2, ...)" and you can use .ExecuteScalar() on
the command object. Be careful with the results: if it's NULL, you'll get
DBNull.Value, otherwise an object of the most appropriate type.

Signature
J.
Peter Duniho - 21 Mar 2008 20:26 GMT
> hey all,
> is it possible to call a sql server scalar function from c#?
Seems like DbCommand.ExecuteScalar() would do what you want. Right?
rodchar - 21 Mar 2008 21:25 GMT
thanks all for the help,
rod.
> hey all,
> is it possible to call a sql server scalar function from c#?
>
> thanks,
> rodchar