2
Answers

error in binding combobox?

honar abubakr

honar abubakr

11y
908
1
when i want to bind a combobo with a table column give me error like error in the image in this link  http://s23.postimg.org/btzj2n66j/Capture.png
 this is my code

  private void bindcombo ()
  {
  OleDbCommand com = new OleDbCommand();
  OleDbDataReader reader;
  com.Connection = db_con;
  db_con.Open();
  com.CommandText = "select * from colleges";
  reader = com.ExecuteReader();
  while(reader.Read())
  {
  string combo_items = reader.GetString("college_name");
  college_name.Items.Add(combo_items);//college_name is a combobox
  }
  db_con.Close();
  }
Answers (2)