0

hi,
Please im developing an application reserves rooms for clients
it is in a way that you cannot insert another clients details if another client has chosen the room for a particular date.
i have binded a comobox with a database that contains information about the various rooms.

MY PROBLEM
on clicking on the combobox that contains the room names and the date a client wants, if it is already booked for in a database, it should bring a message box that the room isnot available.else, if no client has chosen the room for the same date, we can go ahead and book the room for the new client.
how do i use the combobox to retrieve information from the database?

3
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by Pgmer
0

You run a query on the database to determine if the room is booked for the requested time. I can't be any more specific becuase you haven't provided any details. But as an example, assuming that bookings are for one hour periods, then the query

select * from bookings where room='C101' and day='2012-07-28' and hour=14

would return one record if room C101 was booked for 2 PM on July 28 by someone else, and zero records if it was free for use.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.