谁能帮助下面的列表元组超过8个元素是不工作:列表元组超过800项
List<Tuple<int, string, double, string, int, string, double, Tuple<int, string>>> tpl = new
List<Tuple<int, string, double, string, int, string, double, Tuple<int, string>>>();
tpl.Add(Tuple.Create(1, "ABC", 100.123, "XYZ", 1, "ABC", 100.123, new Tuple<int, string>(100, "My Rest Item")));
foreach(var k in tpl)
listBox1.Items.Add(k.Item1.ToString() + " ---> " + k.Item2.ToString() + " ---> " + k.Item3.ToString() + " ---> " +
k.Item4.ToString() + " ---> " + k.Item5.ToString() + " ---> " + k.Item6.ToString() + " ---> " +
k.Item7.ToString() + " ---> " + k.Rest.Item1.ToString());
它提供了以下错误
错误1 的最佳重载的方法匹配'
System.Collections.Generic.List<System.Tuple<int,string,double,string,int,string,double,System.Tuple<int,string>>>.Add(System.Tuple<int,string,double,string,int,string,double,System.Tuple<int,string>>)
' 有一些无效参数C:\ Users \ Hewlett Packard \ AppData \ Local \ Temporary Projects \ WindowsFormsApplication1 \ Form1.cs 68 17 WindowsFormsApplication1 and Er ROR 2参数1:不能从 'System.Tuple<int,string,double,string,int,string,double,System.Tuple<System.Tuple<int,string>>>
' 到 'System.Tuple<int,string,double,string,int,string,double,System.Tuple<int,string>>
' 转换C:\用户\惠普 惠普\应用程序数据\本地\临时 项目\ WindowsFormsApplication1 \ Form1.cs中68 25 WindowsFormsApplication1
除了 - 不要这样做!用相关属性等创建你自己的命名类型。 –