Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void Button1(Object sender, EventArgs e)
- {
- con.Open();
- MySqlCommand cmd = con.CreateCommand();
- cmd.CommandType = CommandType.Text;
- 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 + "')";
- cmd.ExecuteNonQuery();
- con.Close();
- <td>
- <asp:Button ID="Button1" runat="server" Text="Add" />
- </td>
- <td>
- <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" style="height: 26px" Text="Delete" />
- </td>
Add Comment
Please, Sign In to add comment