提高FOR插入数据库动作的优化代码

await Task.Factory.StartNew(() =>
Parallel.ForEach(result.data.o, s =>
{
sql = "insert into employee(FUserName,FUserCode,FContent,FDate) values('" + s.d[1] + "','" + s.d[0] + "','','" + DateTime.Now + "')";

MySqlHelper.ExecuteNonQuery(sql);
}));

posted on 2016-08-16 16:05  ~紫鱼~  阅读(188)  评论(0编辑  收藏  举报