Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MySqlConnection mson = new MySqlConnection("datasource/localhost;port=3306,username=root,password=password");
- MySqlCommand mcd;
- MySqlDataReader mdr;
- public Form1()
- {
- InitializeComponent();
- }
- // The following section is to make the frameless-form draggable :Begin
- protected override void WndProc(ref Message m)
- {
- base.WndProc(ref m);
- if (m.Msg == WM_NCHITTEST)
- m.Result = (IntPtr)(HT_CAPTION);
- }
- private const int WM_NCHITTEST = 0x84;
- private const int HT_CLIENT = 0x1;
- private const int HT_CAPTION = 0x2;
- //::End::
- private void button2_Click(object sender, EventArgs e) //Exit button
- {
- this.Close();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- // TODO: This line of code loads data into the 'airtelWorkDataSet.table1' table. You can move, or remove it, as needed.
- this.table1TableAdapter.Fill(this.airtelWorkDataSet.table1);
- }
- private void btn_add_Click(object sender, EventArgs e)
- {
- try
- {
- string strsql = "insert into table1 (ID,Source IP,Source Misc_ IP,Destination IP,Misc. Destination IP,Application,Protocol,Port)values('" + ipAddressControl1.Text + "','" + ipAddressControl2.Text + "','" + ipAddressControl3.Text + "','" + ipAddressControl4.Text + "','" + ipAddressControl5.Text + "','" + ipAddressControl6.Text + "','" + ipAddressControl7.Text + "')";
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- finally
- {
- mdr.Close();
- mson.Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement