查询
我想用一个DropDownlist将数据库总的字段显示出来,在用一个TEXTBOX显示如果选定了DropDownlist中的某个字段,然后就在TEXTBOX里输入这个字段下面的值,再在数据库中找出来,例如:我在DropDownlist中选择了货号,然后在TEXTBOX中输入一个货号比如10011,然后点击查询到数据库中查找,这中查询该怎么做呢?
protected void Button1_Click1(object sender, EventArgs e)
{
if (this.DropDownList1.SelectedValue == "学号或姓名")
{
this.GridView1.DataSourceID = "AccessDataSource2006xuehao";
this.GridView2.DataSourceID = "AccessDataSource2005xuehao";
this.GridView3.DataSourceID = "AccessDataSource2007xuehao";
else if (this.DropDownList1.SelectedValue == "家长姓名或工作单位")
} {
this.GridView1.DataSourceID = "AccessDataSource2006jiazhang";
this.GridView2.DataSourceID = "AccessDataSource2005jiazhang";
this.GridView3.DataSourceID = "AccessDataSource2007jiazhang";
}