日期:2014-05-17 浏览次数:20756 次
//这是线程循环里面
private void dataMove(int i,int j)
{
if (this.InvokeRequired)
{
SetPos setpos = new SetPos(dataMove);
this.Invoke(setpos, new object[] { i,j });
}
else
{ progressBar1.Maximum = Convert.ToInt32(total); //设定进度条最大值为查询的记录数
progressBar1.Step = Convert.ToInt32(Math.Ceiling(everycount / 5)); //进度条每次增加
if (progress != Convert.ToDecimal(lblTotal.Text))
{
progress += Convert.ToInt32(everycount); //设置分段值
}
timer1.Start();
thread.Suspend(); //挂起线程
//执行迁移
if (!bsERP.BL.b_productProduceScan.SaveData(trans, Convert.ToInt32(everycount), j))//如果返回false,则记录其条数
{
MessageBox.Show(lblTableName.Text +"迁移失败!","系统提示");
trans.Rollback();