protected void Button1_Click1(object sender, EventArgs e) { hostelop h = new hostelop(); DataSet ds = h.dbselect(Places.Text); ShowData.DataSource = ds; ShowData.DataMember = "hostel"; ShowData.DataBind(); }
protected void BindTable() { String CS = ConfigurationManager.ConnectionStrings["ConnectionString2"].ConnectionString; using (SqlConnection con = new SqlConnection(CS)) { using (SqlCommand cmd = new SqlCommand("select * from tbl_fitness_check", con)) { using (SqlDataAdapter sda = new SqlDataAdapter(cmd)) { DataTable dt = new DataTable(); sda.Fill(dt); ShowData.DataSource = dt; ShowData.DataBind(); } } } }