How to access an SQL function via .NET DataAdapter?

D

Dick Swager

Is there a way to use a DataAdapter to retrieve data via an SQL function? I
have done what I need to do using a stored procedure that returns a 1x1
table, but it seems like it would be much cleaner if the single value
returned by a function could be obtained. Maybe there is some mechanism
other than a DataAdapter. I've been away from this stuff for a while and
I'm trying to re-learn a lot of the C++ / SQL interaction stuff with .NET.

Dick
 
G

Guest

Dick,

Use a command object, for example an SQLCommand object if you are working
with SQL Server.

You can use the command object's ExecuteScalar method to retrieve a single
value.

Kerry Moorman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top