try {
foreach (DataRow row in dtTargetTable.Rows)
{
string ec_khh = row["ec_khh"].ToString();
string ec_name = row["ec_name"].ToString();
string ec_phone = row["ec_phone"].ToString();
string ec_tel = row["ec_tel"].ToString();
string ec_bh = row["ec_bh"].ToString();
string ec_azrl = row["ec_azrl"].ToString();
string ec_pbbh = row["ec_pbbh"].ToString();
string ec_xlbh = row["ec_xlbh"].ToString();
string ec_ydxz = row["ec_ydxz"].ToString();
string ec_dbxh = row["ec_dbxh"].ToString();
string ec_bqzs = row["ec_bqzs"].ToString();
string ec_bl = row["ec_bl"].ToString();
int i = 0;
foreach (DataRow row1 in dtTempTable.Rows)
{
i++;
//label1.Text = i.ToString();
string hh = row1["hh"].ToString();
string hm = row1["hm"].ToString();
string yddz = row1["yddz"].ToString();
string bh = row1["bh"].ToString();
string cbxh = row1["cbxh"].ToString();
string dh = row1["dh"].ToString();
string yddh = row1["yddh"].ToString();
string azrl = row1["azrl"].ToString();
string pbbh = row1["pbbh"].ToString();
string xlbh = row1["xlbh"].ToString();
string ydxz = row1["ydxz"].ToString();
string zch = row1["zch"].ToString();
string dbxh = row1["dbxh"].ToString();
string bqzzz = row1["bqzzz"].ToString();
string bl = row1["bl"].ToString();
if (hh == ec_khh) //如果目标表中存在相应数据
{
isexist = true; row["ec_name"] = hm;
row["ec_address"] = yddz;
row["ec_phone"] = yddh;
row["ec_tel"] = dh;
row["ec_bh"] = bh;
row["ec_azrl"] = azrl;
row["ec_pbbh"] = pbbh;
row["ec_xlbh"] = xlbh;
row["ec_ydxz"] = ydxz;
row["ec_dbxh"] = dbxh;
row["ec_bqzs"] = bqzzz;
row["ec_bl"] = bl; row1.Delete();
dtTempTable.AcceptChanges();
break;
}
}就是对两张表进行数据比较,因为数据量比较多大概两张在10w数据左右,导致程序运行很慢,请问如何用多线程进行啊。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货