I want to insert each row in SQL into combobox, where EmployeeID will be combobox Value, and EmployeeFirstName EmployeeLastName will be text of combobox item. However this line<
Items.Insert
is looking for you to Insert at a specific point in the ComboBox list.
You want to use Items.Add
comboBox1.Items.Add(dr.GetString(1) + dr.GetString(2) + dr.GetInt32(0));
If you want to use Insert
it would need to be something like this:
comboBox1.Items.Insert(0, dr.GetString(1) + dr.GetString(2) + dr.GetInt32(0));