Guest User

Untitled

a guest
Jan 24th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. protected void Button1(Object sender, EventArgs e)
  2. {
  3. con.Open();
  4. MySqlCommand cmd = con.CreateCommand();
  5. cmd.CommandType = CommandType.Text;
  6. cmd.CommandText = "Insert into contacts values('" + txtname.Text + "','" + txtposition.Text + "','" + txthp.Text + "','" + txtcompany.Text + "','" + txtaddress.Text + "','" + txtpostcode.Text + "','" + txtstate.Text + "','" + txtcountry.Text + "','" + txttel.Text + "','" + txtdirect.Text + "','" + txtfax.Text + "','" + txtemail.Text + "')";
  7. cmd.ExecuteNonQuery();
  8.  
  9. con.Close();
  10.  
  11. <td>
  12. <asp:Button ID="Button1" runat="server" Text="Add" />
  13. </td>
  14. <td>
  15. <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" style="height: 26px" Text="Delete" />
  16. </td>
Add Comment
Please, Sign In to add comment