StringBuilder sb=new StringBuilder();
            string strId=dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["id"].Value.ToString();
            int iCnt = 0;//临时计数器
            for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
            {
                sb.AppendFormat("update t_location set exportflag='1' where id={0}",strId);
                iCnt += 1;
                if (iCnt == 100)
                {
                    DBUtility.DB.FromSql(sb.ToString()).Execute();
                    sb.Clear();
                    iCnt = 0;
                }
            }
            if (sb.ToString() != "")
            {
                DBUtility.DB.FromSql(sb.ToString()).Execute();
            }

  

相关文章:

  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-26
  • 2022-12-23
  • 2021-07-26
  • 2022-01-20
猜你喜欢
  • 2021-06-23
  • 2021-08-05
  • 2021-10-20
  • 2021-12-25
  • 2021-09-09
  • 2021-05-17
  • 2022-01-15
相关资源
相似解决方案