TextBox3.Text = myset.Tables["azy"].Rows[0].ItemArray["clff2"].ToString();
       TextBox4.Text = myset.Tables["azy"].Rows[0].ItemArray["zzm"].ToString();
       TextBox8.Text = myset.Tables["azy"].Rows[0].ItemArray["bzlx"].ToString();为什么提示错误无法将类型“string”隐式转换为“int” clff2 和 zzm 等都是数据库的列名

解决方案 »

  1.   

    ItemArray["bzlx"] z这样写可以么  
      

  2.   

     TextBox1.Text = Session["km"].ToString();
            TextBox5.Text = Session["ddmc"].ToString();
            TextBox6.Text = Session["zhlx"].ToString();
            myad = new SqlDataAdapter("select * from imgtable where km = '" + TextBox1.Text + "%' and zhlx = '" + TextBox5.Text + "' and ddmc = '" + TextBox6.Text + "'", sqlCon);
            myad.Fill(myset, "azy");
            string a = myset.Tables["azy"].Rows[0].ItemArray["clff"].ToString();
            TextBox2.Text = a;
           TextBox3.Text = myset.Tables["azy"].Rows[0].ItemArray["clff2"].ToString();
           TextBox4.Text = myset.Tables["azy"].Rows[0].ItemArray["zzm"].ToString();
           TextBox8.Text = myset.Tables["azy"].Rows[0].ItemArray["bzlx"].ToString();

            这个是全部代码
      

  3.   

    假设你的azy表中clff2是第一列
    TextBox3.Text = myset.Tables["azy"].Rows[0][0]ToString(); 另外两列类推