Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试从名称值集合中获取值并尝试将其存储在字符串数组中
for (int i=0; i<arr.Length; i++) { arr[i] = DataRowColl.GetValue[i]; }
DataRow.Col 是我的名称值集合。它给出了不带括号引用的错误,我可以在字符串数组中从我的集合中分配值吗??
GetValue不是 的成员NameValueCollection。该函数被调用Get。如果要使用[]运算符,则不必调用该Get函数。所以打电话
GetValue
NameValueCollection
Get
[]
arr[i] = DataRowColl[i];
或者:
arr[i] = DataRowColl.Get(i);