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";
}
當我搜索我沒有得到任何可用房間綁定兩個確定時代「沒有房間availble的」是將拿出什麼,我有這麼多的房間 我的目的是爲用戶在搜索它將通過數據表預留,reservations.roomid比較它與表房間rooms.roomid他們顯示那些項目的結果,但不是在預訂中找到,但在房間表中的網格視圖.. 這就是所有如何在網格視圖
謝謝請幫我出來
問題可能出在SQL語句上。你是否在經理工具上針對數據庫運行它們? – melancia
請給出一些關於你的問題的更多細節.. – Shivaay