How to retrieve the returned function value?

G

Guest

Hi, friends,

I need to call a function of SQL Server 2000. I tried to use
DataSet.SelectCommand by passing a stored procedure command, and then fill
the dataset. This works fine with store procedures that return record sets.
But failed this time. What is correct way to do this? Thanks a lot
 
P

Patrice

What do you you do exactly ?

I would try SELECT * FROM MyFunction() instead of calling the function as a
stored procedure...

Patrice
 
G

Guest

I wrap it in SQL like so:
Select dbo.MyFunction('arg1','arg2')
Note that I could also run this line in Query Analyzer.

I then execute the SQL and store the results as a DataTable (if the function
returned data). I built a method in our DataLayer to make this easier:
DataTable ExecuteSql(string strSqL) {...}


Tim
http://timstall.dotnetdevelopersjournal.com/
 

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