Venkat K replied to goldy gupta
02-Sep-10 02:08 AM
Helo gupta
This logic you need to maintain in the database. You can add a new columns booked in the table so that you can update it with a value 0/1 based on the booking status.
Support as per your example if 5 and 8 are booked then the data in the database should be as below:
(here in booked
0-refers not booked
1 - refers booked
SeatNo. Booked
1 0
2 0
3 0
4 0
5 1
6 0
7 0
8 1
So when you are retieving values in the first combobox then you need to fetch the values using the below query
SELECT SeatNo FROM tblSeats WHERE Booked=0
So this query will return only the empty seats. When a seat is booked you need to update the booked column value with 1 as below:
UPDATE tblSeats SET Booked=1 WHERE SeatNo=@seatnumber
Hope this helps you!
Thanks