protected void UpdateButton(object sender, EventArgs e) { SqlConnection conn = new SqlConnection(); conn.ConnectionString = ConfigurationManager.ConnectionStrings["PersonTest"].ConnectionString; SqlCommand cmd = new SqlCommand(); cmd.CommandText = "UPDATE Person SET (Name=@Name,Family=@Family) where (PersonId=@PersonId)"; cmd.Parameters.AddWithValue("@Name", textbox1.Text); cmd.Parameters.AddWithValue("@Family", TextBox2.Text); cmd.Parameters.AddWithValue("@PersonId", txtId.Text); cmd.Connection = conn; conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)