0
点赞
收藏
分享

微信扫一扫

同时执行多条SQL语句的方法

萧萧雨潇潇 2022-07-12 阅读 65


  1. public int
  2. {
  3. string sql = "insert into test(b) values('e');SELECT @@IDENTITY AS 'Identity' ";
  4. object obj=ExecuteScalar(sql, null);
  5. return int.Parse(obj.ToString());
  6. }


执行一条插入语句,并将整个表获取到一个datatable中


  1. public
  2. {
  3. string sql = "insert into test(b) values('e');select * from test order by a desc ";
  4. null).Tables[0];
  5. return
  6. }
举报

相关推荐

0 条评论