title: Value ComboBox Change Value Of TextBox In C#
body: <p>Hello experts i use this code Some time ago and is work ,but now is not work...!! it Says</p>
  
  <blockquote>
    <p>(Conversion failed when converting the varchar value
    'System.Data.DataRowView' to data type int)</p>
  </blockquote>
  
  <p>the code is combobox select value change textbox with Details of this value And thank you in advance.</p>
  
  <pre><code> public partial class test : Form
  {
  
      SqlConnection cn = new SqlConnection("Server=AMEER;DataBase=custemer_net;Integrated security=true");
      SqlDataAdapter da;
      DataTable dt = new DataTable();
      DataTable dttt = new DataTable();
      public test()
      {
          InitializeComponent();
          da = new SqlDataAdapter("Select *from subscrbtion ", cn);
          da.Fill(dt);
          comboBox1.DisplayMember = "name";
          comboBox1.ValueMember = "id";
          comboBox1.DataSource = dt;
  
      }
  
      private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
      {
          da = new SqlDataAdapter("select * from subscrbtion where id='" + comboBox1.SelectedValue + "'", cn);
          da.Fill(dttt);
          textBox1.Text = dttt.Rows[0]["phone"].ToString();
      }
  </code></pre>