string strconn = "server=WWW-51F7B2A9835\\SqlExpress;Initial Catalog=student;Integrated security=SSPI";
SqlConnection conn = new SqlConnection(strconn);
conn.Open();
SqlDataAdapter myad = new SqlDataAdapter("select t_no, t_name,t_post from teacher where t_no==num .Text.Tostring() | t_name==name.Text.Tostring() | t_post==zichen.Text.tostring()",conn );
DataSet ds = new DataSet();
myad.Fill(ds, "teacher");
DataGrid1.DataSource = ds;
DataGrid1.DataBind();
}
myad.Fill(ds, "teacher");这句有错