Hello everybody this is my first post so I apologize if I made any mistakes.
I have encountered a problem in my code where repeated values are displayed in the combobox dropdown selection. I am trying to display values from a column in my Access database.
Here is my code.
private void Spisak_Load(object sender, EventArgs e)
{
OleDbConnection konekcija = new OleDbConnection(@"Provider = Microsoft.ACE.OLEDB.12.0; Data Source = D:\Programiranje\Programi\Izlozba Pasa\Izlozba Pasa\izlozba.accdb");
konekcija.Open();
OleDbCommand komanda = new OleDbCommand("SELECT Sifra, NazivRase FROM Izlozba, Rasa", konekcija);
OleDbDataReader reader = komanda.ExecuteReader();
while(reader.Read())
{
comboBox1.Items.Add(reader["Sifra"].ToString());
comboBox2.Items.Add(reader["NazivRase"].ToString());
}
}