string [] str1=new string [dgvProduce .Rows .Count ];
  str1=dgvProduce .Rows [i].Cells [1].Value .ToString ();
无法将类型“string”隐式转换为“string[]”
谁能说说这什么错误啊

解决方案 »

  1.   

    dgvProduce .Rows [i].Cells [1].Value .ToString 这是string类型,不是string[]类型
    str1是数组
      

  2.   


    str1[0]=dgvProduce .Rows [i].Cells [1].Value .ToString ();
    //如果你是想取出你的dgv里面的某列的话可以这样做            for (int i = 0; i < dgvProduce .Rows .Count ; i++)
                {
                   str1[i]=dgvProduce .Rows [i].Cells [1].Value .ToString ();
                }
      

  3.   

    我的意思是,把DGV里面的一列数据取出来,然后用一个messagebox一次显示出来啊
      

  4.   


    string str1="";
    for(...)
    {
    str1+=dgvProduce .Rows [i].Cells [1].Value .ToString ();
    //在循环中把'='改成'+='就可以了
    }
      

  5.   

    string [] str1=new string [dgvProduce .Rows .Count ];
    string str="";
    for(int i=0;i<str1.length;i++)
    {
       str+=dgvProduce .Rows [i].Cells [1].Value .ToString ()+",";
    }
    str1=str.split(',');
      

  6.   

    string  str1=dgvProduce .Rows .Count;
    str1=dgvProduce .Rows [i].Cells [1].Value .ToString ();这样!!!
      

  7.   

    string[] 可以看作是 string 的集合。要实现你的功能,可以根据这位说的那么办,建议多多看看基础啊。多多练习下就知道了。
      

  8.   

    string [] str1=new string [dgvProduce .Rows .Count ];
    这是什么语法 总该要这样吧string[] strs=new String[Count]{"asfd","ddd"};
      

  9.   

    如错误所见,一个类型为string,一个类型为string数组
    当然会报错