thanks.What does your UDF do? Does it return a Table value? You would treat the resultset the same way you would with any other table/stored procedure resultset.
I think more information is needed here.
Terri|||I am not aware that you can call a UDF from ADO.NET directly. You can call a stored procedure, and so perhaps you will need to wrap your UDF call in a stored procedure. More information about what the UDF does (and what it is returning) will help.|||my UDF returns a table, i have been reading some tutorials and books, and they say that "one of the advantages of using UDF is that it is possible to use it from many applications." however, i have been going nuts trying to find some help on how to code this.
if i cant use UDF, can i use stored procedures to retrive a table? i read that you can only update data with stored procedures, and that u get tables with UDF's...
thanks for your help guys.|||You can absolutely return tables from a stored procedure, and you can certainly call a stored procedure from ADO.NET on an ASP.NET page.
This link should help explain how to do it.|||thanks!|||And you can absolutely also call UDFs from ADO.NET on an ASP.NET page.
SELECT * FROM dbo.fnMyFunctionThatReturnsATable
But personally I wouldn't call the UDF directly. I'd make a stored procedure which calls the UDF.
Terri|||True, true. I have never used UDF's that way, but no reason you cannot. There is just not a CommandType.UserDefinedFunction...
Thanks!|||Hi All,
1. Here is an example of ASP.NET calling UDF returns a TABLE
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=265546
Re: Calling a SQL 2k UDF from .aspx page
-- See Posted: 07-02-2003 02:11 AM
2. As for using it, you make a judgement call.
3. You can use sp to wrap your UDF: There is an example
-CREATE FUNCTION dbo.udf_Txt_SplitTAB
-CREATE PROCEDURE sp_SELECT_IN
to wrap UDF.
-private void ASP_NET_SELECT_IN (string IN_List_Values)
to call sp.
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=280390
sql
No comments:
Post a Comment