protected void ButtonUpdate_Click(object sender, EventArgs e) { var connectionString = "server=127.0.0.1;uid=root;" + "pwd=xxxxxxxx;database=DBFB;"; MySql.Data.MySqlClient.MySqlConnection conn = new MySql.Data.MySqlClient.MySqlConnection(connectionString); using (MySqlConnection con = new MySqlConnection(connectionString)) using (MySqlCommand cmd = new MySqlCommand("update TBL_FB Set FirstName=@FirstName, LastName=@LastName, ContactNumber=@ContactNumber, Email=@Email, Message=@Message where ID= " + Request.QueryString["ID"], con)) { cmd.Parameters.Add("@FirstName", TextBoxFirstName.Text); cmd.Parameters.Add("@LastName", TextBoxLastName.Text); cmd.Parameters.Add("@ContactNumber", TextBoxContactNumber.Text); cmd.Parameters.Add("@Email", TextBoxEmail.Text); cmd.Parameters.Add("@Message", TextBoxMessage.Text); con.Open(); cmd.ExecuteNonQuery(); } Response.Redirect("Details.aspx?ID=" + TextBoxID.Text); }
<pre lang="Javascript"> if (Page.IsPostBack) { }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)