SqlCommand mcd = new SqlCommand("update Customer_Info set Name=@name,Gender=@gender,DateOfBirth=@DOB,EmailID=@email,Mob_No=@mob,Landline_No=@land,Address=@address,State=@state,City=@city,PinCode=@pincod,Last_Login=@logi where UserName=@user1", con);
mcd.Parameters.AddWithValue("@name",TextBox1.Text);
mcd.Parameters.AddWithValue("@gender",gender);
mcd.Parameters.AddWithValue("@DOB",TextBox2.Text);
mcd.Parameters.AddWithValue("@email",TextBox3.Text);
mcd.Parameters.AddWithValue("@mob", TextBox4.Text);
mcd.Parameters.AddWithValue("@land", TextBox5.Text);
mcd.Parameters.AddWithValue("@address", TextBox6.Text);
mcd.Parameters.AddWithValue("@state", TextBox7.Text);
mcd.Parameters.AddWithValue("@city", TextBox8.Text);
mcd.Parameters.AddWithValue("@pincod", TextBox9.Text);
mcd.Parameters.AddWithValue("@logi",datelog);
mcd.Parameters.AddWithValue("@user1",lblUserName.Text.Trim());
int d = mcd.ExecuteNonQuery();
if (d > 0)
{
Response.Write("<script>alert('updated ....')</script>");
它只更新我的数据库一次。当我再次尝试更新时,它没有获得价值。为什么?