转换错误,是因为他们根部不是一个类型,所以肯定报错。
你要输出 也很简单
foreach (var colNumber in colNumbers)
            {
                foreach (var i in colNumber)
                {
                    Console.WriteLine(i);
                }
            }   
 或者 for (int i = 0; i < colNumbers[0].Count(); i++)
            {
                Console.WriteLine(colNumbers[0][i]);
            },因为   colNumbers下的成员是  Collection<int> numbers=new Collection<int>();
所以你要输出numbers的程序员

解决方案 »

  1.   

    List<int> theNumbers2 = numbers.Cast<int>().ToList();
      

  2.   

    public class Collection<T> : IList<T>
    Collection<T>实现了IList<T>,所以Collection<T>可以转换成IList<T>public class List<T> : IList<T>
    而List<T>与Collection<T>没啥关系的,如果不能直接转的for (int k = 0; k < colNumbers.Count(); k++)
                {
    for(int j = 0; j < colNumbers[k].Count(); ++j)
    {
                    MessageBox.Show(colNumbers[j].ToString());/
    }
                }
      

  3.   

    Collection类实现了IList接口,但不是List的子类,所以不能强制转换,但可以用其他方法生成.
      

  4.   

                for (int k = 0; k < colNumbers.Count; k++)
                {
                    for (int i = 0; i < colNumbers[k].Count;i++)
                    {
                        MessageBox.Show(colNumbers[k][i].ToString()); 
                    }
                }
      

  5.   

    List<T>和Collection<T>都是实现IList<T>。
    作为子类,转父类是安全的;但是子类之间不能直接转换。