我要提取一个内容
是这样的我想在他选择回复的时候是
数据库里的字段“ huifu” 是有内容的 然后当选择未回复的时候 “ huifu”为空的
选择那个上面的请选择的时候是 所有的 包括为空和不为空的?
我是这样写的
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
Label2.Text = DropDownList1.SelectedIndex.ToString();
if(DropDownList1.SelectedIndex==0)
{
SqlConnection conn = GetConnection();
conn.Open();
SqlDataAdapter da;
da = new SqlDataAdapter("Select * From admin_pl", conn);
DataSet ds = new DataSet();
da.Fill(ds, "news");
Datagrid1.DataSource = ds.Tables["news"].DefaultView;
Datagrid1.DataBind();
}
else if (DropDownList1.SelectedIndex == 1)
{
SqlConnection conn = GetConnection();
conn.Open();
SqlDataAdapter da;
da = new SqlDataAdapter("Select * From admin_pl where huifu=????", conn);
DataSet ds = new DataSet();
da.Fill(ds, "news");
Datagrid1.DataSource = ds.Tables["news"].DefaultView;
Datagrid1.DataBind();
}
else if (DropDownList1.SelectedIndex == 2)
{
SqlConnection conn = GetConnection();
conn.Open();
SqlDataAdapter da;
da = new SqlDataAdapter("Select * From admin_pl where huifu=null", conn);
DataSet ds = new DataSet();
da.Fill(ds, "news");
Datagrid1.DataSource = ds.Tables["news"].DefaultView;
Datagrid1.DataBind();
}
}
其中那个请选择和未回复好使 可是那个sql语句不会写 ??怎么写呢?