單下拉列表,從和到日期和搜索按鈕。 當用戶從下拉列表中選擇值選擇日期並按搜索按鈕用戶可以根據選定的字段在網格中查看數據直到現在我已經完成我的項目現在我想要的是當我選擇複選框來顯示與特定列相關的數據散裝gridview的假設我有50個用戶和25個來自新德里市現在我想,當用戶選擇複選框只能查看德里用戶在網格我該怎麼辦that..thanks提前 如何在網格中顯示與所選複選框相關的數據
protected void Chk_CheckedChanged(object sender, EventArgs e)
{
if (Chk.Checked!=null)
{
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter();
SqlConnection con;
if (ddlPortal2.SelectedIndex != 0)
{
con = new SqlConnection("Data Source=.;Initial Catalog=Bart;Integrated Security=True");
con.Open();
da = new SqlDataAdapter("select * from Form3 where Portal='" + ddlPortal2.SelectedValue + "' and Query=Query", con);
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
con.Close();
}
}