string sql = "select * from teacher where Teaid LIKE '% " + TextBox1.Text + " %'";
SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationManager.ConnectionStrings["teacher"].ConnectionString;
SqlCommand cmd = new SqlCommand(sql, con);
SqlDataAdapter dp = new SqlDataAdapter();
DataSet ds = new DataSet();
dp.Fill(ds);
GridView2.DataSource = ds.Tables[0];