C#并行循环的使用

阅读 167

2022-04-26

//	并行循环的使用
			int countNum = 0;
			List<orderInfo> repostsData = new List<orderInfo>();
			string sql = string.Format("Select Top 100000 orderNo from [order] ");
			repostsData = FollowUpReport_InitializeLINQ_D(sql);
            if (repostsData.Count > 0)
            {
				Parallel.ForEach(repostsData, item => {
					sql = string.Format("update [order] set aaa = 123 where ddbh = '{0}'", item.ddbh);
					countNum += ExecuteSql(sql);
				});
            }

精彩评论(0)

0 0 举报