Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void cmdSave_Click(object sender, EventArgs e)
- {
- try
- {
- con = new OleDbConnection(cs.DBConn);
- con.Open();
- string queryInsert = @"INSERT INTO tblFixing(CodBefore)
- VALUES
- (@CodBefore)";
- cmd = new OleDbCommand(queryInsert);
- cmd.Connection = con;
- cmd.Parameters.Add(new OleDbParameter("@CodBefore", OleDbType.WChar, 0, "CodBefore"));
- cmd.Parameters["@CodBefore"].Value = rchCodBefore.Text.Trim();
- cmd.ExecuteNonQuery();
- MessageBox.Show("Successfully saved", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
- cmdSave.Enabled = false;
- con.Close();
- }
- catch (Exception ex)
- {
- MessageBox.Show("ErrornDetalhes: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement