Kreshnike Rahmani

Kreshnike Rahmani

  • NA
  • 14
  • 16.4k

Valuemember and DisplayMember Iin a combobox??? Pls help

Dec 7 2012 9:38 AM

SqlCommand cmd = new SqlCommand("select ID_niveli from Niveli", con);
SqlDataReader dReader = cmd.ExecuteReader();

if (dReader.HasRows == true)
{
while (dReader.Read())

cmbNiveliRegj.Items.Add(dReader["ID_niveli"].ToString());

}
dReader.Close();




In this code I need in my combobox the value member to be ID_niveli, but to be displayed NameN?!?


Answers (3)