-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhotel.aspx.cs
39 lines (35 loc) · 1.02 KB
/
hotel.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public partial class hotel : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["PTGcnn"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindListView();
}
}
public void BindListView()
{
con.Open();
using (SqlDataAdapter sda = new SqlDataAdapter("SELECT * FROM Hotel_Table where hotel_id='" + Request.QueryString["o"] + "'", con))
{
DataTable dt = new DataTable();
sda.Fill(dt);
lv_hotelIntro.DataSource = dt;
lv_hotelIntro.DataBind();
lv_hotelDetails.DataSource = dt;
lv_hotelDetails.DataBind();
}
con.Close();
}
}