title: Assign value member from database to combobox
body: <p>I'm trying to select two columns from my database, one to make it displaymember in my combobox and the other one to make it the valuemember</p>
  
  <p>My code goes like:</p>
  
  <pre><code>SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=c:\users\administrator\documents\visual studio 2010\Projects\Clinic\Clinic\Clinc.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True");
  con.Open();
  SqlDataAdapter da = new SqlDataAdapter("select ClinicName,ClinicCode from Clinic",con);
  DataSet ds = new DataSet();
  da.Fill(ds);
  comboBox1.DataSource = ds.Tables[0];
  comboBox1.DisplayMember = "ClinicName";
  comboBox1.ValueMember = "ClinicCode";
  </code></pre>
  
  <p>It does fetch the data from database and display it well, but can't set the valuemember.</p>
  
  <p>When I try to print it to label to see it, the label displays "cliniccode"</p>
  
  <p>What's wrong ?</p>