2
Reply

error in binding combobox?

honar abubakr

honar abubakr

Jul 31 2013 6:48 AM
900
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)