I would like to read all of the values from the column name "seatNo" and store those values within a list. I've done most of the code but i have absolutely no idea how to actually store the values
Here is what i have so far:
Here is what i have so far:
C#:
private List<string> seatNumbers = new List<string>();
public void PreparingSeatUI()
{
string GetDataQuery = "SELECT seatNo FROM bookings where schedule = @scheduleId";
cmd = new SqlCommand(GetDataQuery, _IsqlDataFunctions.GetConnection());
cmd.Parameters.AddWithValue("@scheduleId", txtSchedule.Text);
_IsqlDataFunctions.GetConnection().Open();
var reader = cmd.ExecuteReader();
while (reader.Read())
{
seatNumbers.Add() // not sure how to add each value here
{
});
}
_IsqlDataFunctions.GetConnection().Close();
}