我在C#中用数据字典聚合拼接SQL语句出错
- C# code
Dictionary<string, int> dicInfo=new Dictionary<string, int>(); dicInfo.Aggregate(strSql,(sql, e) => sql.AppendFormat(" insert into PRO_WorkloadInfo_Detail(detail_id,project,Data) values(@nextid,'{0}',{1}) ", e.key, e.Value));//这边e.key报错,cannot access private field 'key' here//请问这是什么原因?
------解决方案--------------------------------------------------------
试试
e.key
=》
e.Key
------解决方案--------------------------------------------------------