string stype = ddlType.SelectedItem.Text;
string strsql = "";
switch (stype)
{
case "学号":
strsql = "select * from tb_Student where StudentNum like '%" + txtKey.Text.Trim() + "%'";
BaseClass.BindDG(gvStuInfo, "ID", strsql, "stuinfo"); ;
break;
case "姓名":
strsql = "select * from tb_Student where StudentName like '%" + txtKey.Text.Trim() + "%'";
BaseClass.BindDG(gvStuInfo, "ID", strsql, "stuinfo");
break;
}