日期:2014-05-17 浏览次数:20739 次
//开线程加载存货档案表
Thread mythread = new Thread(new ThreadStart(myFunction));
mythread.IsBackground = true;
mythread.Start();
//this.inventoryc = myoper.GetInventory();
//this.comboBox6.DataSource = this.inventoryc;
this.comboBox7.DisplayMember = "judge";
this.comboBox7.ValueMember = "id";
this.comboBox7.DataSource = myoper.GetJudge();//这个方法也是去数据库读取数据装入DataTable作为comboBox7的数据源。这个方法会报错:System.InvalidOperationException: 已有打开的与此命令相关联的 DataReader,必须首先将它关闭。
private void myFunction()
{
MFinalCheckOper myoper = new MFinalCheckOper(MySystemInfo);
this.inventoryc =myoper.GetInventory();
this.BeginInvoke(new MethodInvoker(delegate()
{
this.comboBox6.DataSource = this.inventoryc;
}));
}