首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

cannot access private field 'key' here解决办法

2012-09-29 
cannot access private field key here我在C#中用数据字典聚合拼接SQL语句出错C# codeDictionarystring

cannot access private field 'key' here
我在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
[解决办法]
探讨
引用:

试试
e.key
=》
e.Key
还真是,这是为什么呢?

热点排行