private void fillHotel(int CityID) { string Error = ""; DBHotel hotelObj = new DBHotel(); DataTable table = hotelObj.getAllHotelDataByCity(CityID, ref Error); GridViewHotel.DataSource = table; GridViewHotel.DataBind(); }
public void PopulateData() { try { GridViewHotel.DataSource = objVisaType.ShowHotels();; GridViewHotel.DataBind(); } catch (Exception ex) { lblMsg.Text = ex.Message; } }
private void gridbind() { da = new SqlDataAdapter("select * from Hotel_Details where H_Country='" + DropDownCountry.SelectedItem.Text + "' and H_City='" + DropDownCity.SelectedItem.Text + "' and Room_Category='" + DropdownCategory.SelectedItem.Text + "'", con); dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count > 0) { if (Request.QueryString["P"] == "UMP") { GridViewHotel.DataSource = dt; GridViewHotel.AllowPaging = true; GridViewHotel.DataBind(); GridViewHotel.Columns[0].Visible = true; cmtLabel.Text = ""; } else if (Request.QueryString["P"] == "GMP") { GridViewHotel.DataSource = dt; GridViewHotel.AllowPaging = true; GridViewHotel.DataBind(); cmtLabel.Text = ""; } else if (Request.QueryString["P"] == null) { GridViewHotel.DataSource = dt; GridViewHotel.AllowPaging = true; GridViewHotel.DataBind(); cmtLabel.Text = ""; } } else { GridViewHotel.DataSource = ""; GridViewHotel.AllowPaging = false; GridViewHotel.DataBind(); cmtLabel.Text = "No Hotel Available "; } }