数据库操作,执行sql 用法
1.执行更新操作 int count= DBUtils.Execute(this.Context, "/*dialect*/update T_SAL_OUTSTOCKENTRY set FNOTE ='测试'"); 多个sql 语句同时执行 int count= DBUtils.ExecuteBatch (this.Context,sqls); sqls 是一个list string list 2.//执行sql语句返回 DataSet DataSet dt = DBUtils.ExecuteDataSet(this.Context, "/*dialect*/select FMATERIALID,FNumber from T_BD_MATERIAL"); 3.//执行sql语句返回 DataTable 同2这种用法比较危险 容易出错 DataTable dt = DBUtils.ExecuteDataSet(this.Context, "/*dialect*/select FMATERIALID,FNumber from T_BD_MATERIAL").Tables[0]; 4.DynamicObjectCollection Dyobj = DBUtils.ExecuteDynamicObject(this.Context, "/*dialect*/select FMATERIALID,FNumber from T_BD_MATERIAL"); 5.IEnumerable<IDataRecord> itemDataTable = DBUtils.ExecuteEnumerable(this.Context, "/*dialect*/select FMATERIALID,FNumber from T_BD_MATERIAL"); 6.using(IDataReader reader = DBUtils.ExecuteReader(this.Context, sql)){ ....} 7.string sql = " SELECT COUNT(1) FROM T_BD_MATERIAL"; int count = DBUtils.ExecuteScalar<int>(this.Context, sql, 0, null); 8.执行sql 怎么少得了存储过程呢 var returnParams = DBUtils.ExecuteStoreProcedure(this.Context, "test",sqlParam);
数据库操作,执行sql 用法
1.执行更新操作int count= DBUtils.Execute(this.Context, "/*dialect*/update T_SAL_OUTSTOCKENTRY set FNOTE ='测试'");多个sql 语句同...
点击下载文档
上一篇:销售订单,超期销售红色,python插件代码,供参考下一篇:打开单据
本文2024-09-16 18:30:29发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-22594.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章