- 爱易网页
-
ASP.NET教程
- 请问 有关问题 —— 个人信息修改 修改不了
日期:2014-05-17 浏览次数:20380 次
请教 问题 —— 个人信息修改 修改不了
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
string id = TextBox1.Text;
string cellphone = TextBox5.Text;
string name = TextBox6.Text;
string socialNum = TextBox7.Text;
string email = TextBox8.Text;
string sex = DropDownList1.SelectedValue.ToString();
string zipcode = TextBox9.Text;
string address = TextBox10.Text;
string SQL = "UPDATE users SET u_name='" + name + "',u_cellphone='" + cellphone + "',";
SQL += "u_socialNum='" + socialNum + "',u_email='" + email + "',u_sex='" + sex + "',u_zipcode='" + zipcode + "',u_address='" + address + "' WHERE u_id='" + id + "';";
SqlConnection conn = new SqlConnection(connectionString);
SqlCommand cmd = new SqlCommand(SQL, conn);
conn = new SqlConnection(connectionString);
cmd = new SqlCommand(SQL, conn);
SqlDataReader rd;
try
{
conn.Open();
rd = cmd.ExecuteReader();
rd.Read();
Response.Write("<script>alert('?? ???????!!!');</script>");
rd.Close();
}
catch (Exception error)
{
Response.Write("<script>alert('?? ???????!!!');</script>");
}
finally
{
conn.Close();
}
点解修改按钮时 页面就变成个空白页面 这个修改函数部分哪里错了呢 谢谢 帮帮看下