Reputation: 34407
I have a UDF in sql server. I want to call this function at frontend (C# Code). Is it possible to do it.
Upvotes: 1
Views: 102
Reputation: 238096
Yeah, just grab a SqlConnection
object and:
var com = yourConnection.CreateCommand();
com.CommandText = "select dbo.MyUdf();";
com.ExecuteScalar();
If it's a table-valued UDF, use ExecuteReader()
or something similiar.
Upvotes: 2