SqlConnection connection = new SqlConnection();
connection.ConnectionString = "Data Source = kumar\\SQLEXPRESS; Initial Catalog = phonebook; Integrated Security = TRUE";
connection.Open();
SqlCommand cmd = new SqlCommand("Select * From contacts", connection);
SqlDataAdapter adp = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adp.Fill(ds, "contacts");
comboBox1.DataSource = ds.Tables["contacts"];
comboBox1.ValueMember = "phone";
comboBox1.DisplayMember = "name";
string pn = comboBox1.ValueMember;
textBox1.Text = pn;
In this code, combobox1.valuemember is set to phone. I need this value in a text box.The current method is not working for me. What I am getting in the textbox is phone instead of the phone number stored in database. Please help