I have a table where I'm saving payments each user made for each month and originally I had column named month but after saving couple of payments for every month it would become too clustered so I decided to ditch column month and add 12 columns named (january, february, etc. all the way to december) and now I want to display all 12 columns in combobox so I can select January and make payment for that month.
void FillCombo()
{
string constring = "server=localhost;user id=David;password=root;persistsecurityinfo=True;database=bazakudsumari";
string Query = "SELECT * FROM bazakudsumari.evidencija_clanarina;";
MySqlConnection connection = new MySqlConnection(constring);
MySqlCommand command = new MySqlCommand(Query, connection);
MySqlDataReader myReader;
try
{
connection.Open();
myReader = command.ExecuteReader();
while (myReader.Read())
{
string sSijecanj = myReader.GetString("sijecanj");
odaberi_mjesec.Items.Add(sSijecanj);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Any way of doing this?