Calling SQL Server functions

Topics: Data Access Application Block
Jan 24, 2007 at 9:38 PM
I was using the hands on labs for EntLib 2.0 and got wondering if we could call stored functions in addition to stored procedures. Does anyone know?

If I want to run the executescalar method, I see there is no enum for CommandTpye.Function. For example:

db.ExecuteScalar( CommandType.StoredProcedure,

where ufn_cntSrcSystem is a function.

Any ideas if it is possible?

Roger Sutter
Jan 25, 2007 at 11:27 AM

I'm not really sure here, but anyway.
I don't think user defined functions have a resultset or anything attached to it.

I would try something like the following

select myuserdefined_function

Best regards,