我可以通过这种方式添加List<string>
数组List<List<string>>
:
List<string> first = new List<string> { "one", "two", "three" };
List<string> second = new List<string> { "four", "five", "six" };
List<List<string>> list_array = new List<List<string>> { first, second };
现在我需要创建几个填充有数据库记录的列表,然后将此列表添加到List<List<string>>
数组中:
List<List<string>> array_list;
while (dr.Read())
{
string one = dr["Row1"].ToString();
string two = dr["Row2"].ToString();
List<string> temp_list = new List<string> { one, two };
//Here I need to add temp_list to array_list
}