首先要说使用线程一定要只是刷新数据(例如此方法)
//启用线程只需要刷新数据即可,使用于频繁刷新(需注意)
public void ReshOrder()
{
try
{
Thread thread = new Thread(
delegate()
{
dt_BusinessOrder = _customService.getBussinessOrders(UserInfo.uNote1, pId, cId, ccId, UserInfo.uParentId);
});
//开启线程刷新数据
thread.Start();
rescdgv(dgvBizOrders, dt_BusinessOrder);
dgvBizOrders.Columns[1].Visible = false;//省ID
dgvBizOrders.Columns[2].Visible = false;//市ID
dgvBizOrders.Columns[3].Visible = false;//地区ID
dgvBizOrders.Columns[4].Visible = false;//商户ID
if (dgvBizOrders.Rows.Count != 0)
{
IsPlaySound = true;
}
else
{
IsPlaySound = false;
}
}
catch { }
}