Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try
- {
- cobPitch.Items.Clear();
- cobPitch.Update();
- Pitchs.Clear();
- reader.Close();
- connection.Open();
- command.Connection = connection;
- command.CommandText = @"SELECT StandplaatsID, Standplaatsnaam, BezetStatus FROM Standplaats WHERE BezetStatus = @value";
- command.Parameters.AddWithValue("@value", 0);
- reader = command.ExecuteReader();
- while(reader.Read())
- {
- Pitch pitch = new Pitch(reader.GetInt32(0), reader.GetString(1), reader.GetInt32(2));
- Pitchs.Add(pitch);
- cobPitch.Items.Add(pitch);
- }
- reader.Close();
- connection.Close();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- finally
- {
- connection.Close();
- }
Add Comment
Please, Sign In to add comment