我创建了列表列表来存储随机生成的数据,但是我的实现显示以下intellisense错误“变量名称在当前上下文中不存在”。我哪里错了?这是我的代码所需的部分。列表访问列表
List<List<string>> DataList = new List<List<string>>();
//Some Code
for (int i = 0; i < num; i++)
{
List<string> strVal = new List<string>();
foreach (string someVal in SomeList)
{
//Some Code
strVal.Add(data);
}
DataList.Add(strVal);
}
for (int i = 0; i < num; i++)
{
foreach (IList<string> name in DataList)
{
foreach (string listVal in strVal) // Error Here
{
//Some Code
}
}
}
我哪里出错了?谢谢。
谢谢。有我的错误。 –