{
string connStr = @"Data Source=LAPTOP-LJNT4FF8;Initial Catalog=SMSstudent;;User ID=sa;pwd=123";
SqlConnection conn = new SqlConnection(connStr);
conn.Open();
string commStr = "update student set studentID='" + studentID.Text.Trim() + "',studentName='" + studentName.Text.Trim() + "',nation='" + nation.Text.Trim() + "',sex='" + sex.Text.Trim() + "',birthday='" + birthday.Text.Trim() + "',telephone='" + telephone.Text.Trim() + "',credithour='" + credithour.Text.Trim() + "',address='" + address.Text.Trim() + "' where studentID='" + studentID.Text.Trim() + "'";
SqlCommand comm = new SqlCommand(commStr, conn);
SqlDataAdapter da = new SqlDataAdapter(comm);
try
{
DataSet ds = new DataSet();
da.Fill(ds);
this.GridView1.DataSource = ds.Tables[0];
this.GridView1.DataBind();
comm.ExecuteNonQuery();
}
catch { }
SqlHelper.ExcuteNonQuery(CommandType.StoredProcedure, "InsertOrUpdate", null);
Response.Write("<script>alert('录入成功')</script>");
conn.Close();
}
点击修改后,数据是修改好了,但是页面没有事实更新,应该怎么修改