开发者

Can I call a UDF at Frontend

开发者 https://www.devze.com 2022-12-26 19:34 出处:网络
I have a UDF in sql server. I want t开发者_如何学Co call this function at frontend (C# Code). Is it possible to do it.Yeah, just grab a SqlConnection object and:

I have a UDF in sql server. I want t开发者_如何学Co call this function at frontend (C# Code). Is it possible to do it.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号