DataTable dt = try.Query(" select Rooms.RoomId, Rooms.RoomType From Rooms INNER JOIN Reservations ON ( Rooms.RoomId = Reservations.RoomId ) AND GETDATE() BETWEEN Reservations.CheckInDate AND Reservations.CheckOutDate ORDER BY Rooms.RoomType");
if (dt.Rows.Count > 0)
{
LblMessage.Text = " No Room Available";
}
else
{
DataTable dt1 = try.Query( "Select Rooms.RoomType, Rooms.PricePerNight From Rooms INNER JOIN Reservations ON (Rooms.RoomId != Reservations.Roomid) ORDER BY Rooms.Roomtype");
if (dt1.Rows.Count > 0)
{
GridResult.DataSource = dt1;
GridResult.DataBind();
}
else
{
LblMessage.Text = "No Rooms Availble";
}
When i search i don't get any available rooms "No Rooms Availble" is what will come up, I have so many rooms available My intention is for user on search it will run through the datatable reservations, reservations.roomid compare it with the table Rooms rooms.roomid them show results of those items that are not find in the reservations but are in the rooms table to the Grid View.. thats all
thanks please help me out