title: Cannot implicitly convert type 'string' to 'int'?
body: <p>what ever I select any name available in combo box it should reflects on text box.
  I m beginner pls pls help me to solve it</p>
  
  <pre><code>public class product
  {
      public int proid { set; get; }
      public string prodname { set; get; }
      public int unitprice { set; get; }
  
  }
  private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)        
  {
      SqlConnection con = new SqlConnection(@"server=xxxx-PC; database= sample; integrated security= true");
      con.Open();
      SqlCommand cmd = new SqlCommand("select * from tblproduct ", con);
      SqlDataReader dr = cmd.ExecuteReader();
      product prod = new product();
      while(dr.read())
      {
          prod.proid = dr[0].ToString();
          prod.prodname = dr[1].ToString();
          prod.unitprice = dr[2].ToString();
          textBox2.Text = proid;
          textBox3.Text = prodname;
          textBox4.Text = unitprice;
      } 
  }
  </code></pre>
  
  <p>With error:</p>
  
  <pre><code>Error   :   The name 'prodname' does not exist in the current context
  Error   :   Cannot implicitly convert type 'string' to 'int'`improved formatting`
  </code></pre>