sql自定义函数及C#中调用

sql自定义函数及C#中调用
1、在C#中调用sql自定义函数

1.1 标量值函数

sql语句调用 select  dbo.GetClassIDWithName(1)  

string strSql = string.Format("select dbo.GetClassIDWithName('{0}')",dtTime);
DataTable dt = DB_Contrast.DB.OleDbHelper.GetDataTable(strSql);

1.2 表值函数

sql语句调用 select * from GetAnalysis('2015-1-15',1) 

string strSql = string.Format("select * from dbo.GetAnalysis('{0}',{1}) where 部门='{2}' ",dtTime, classid,"开发");
DataSet ds = DB_Contrast.DB.OleDbHelper.GetDataSet(strSql);
来源:https://www.cnblogs.com/xiaochun126/p/4226296.html

 

posted @ 2020-08-03 11:53  BloggerSb  阅读(459)  评论(0编辑  收藏  举报