private void InsertDatabase()
 {
     try {
         string query = "INSERT INTO MsEmployee VALUES ('" + txtID.Text + "','" + txtName.Text + "','" + txtEmail.Text + "','" + txtPass.Text + "','" + cbxRole.Text + "')";
         con.ExecuteUpdate(query);
     } catch (Exception ex) {
         MessageBox.Show(null, ex.ToString(), "An exception occured", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 2
0
 private void InsertDatabase()
 {
     try {
         string query = "INSERT INTO MsBook VALUES ('" + txtBookID.Text + "','" + txtBookTitle.Text + "','" + cbxBookTypeID.Text + "'," + txtPrice.Text + "," + numTotalPage.Value.ToString() + ",'" + txtAuthor.Text + "','" + txtPublisher.Text + "','" + txtISBN.Text + "'," + numStock.Value.ToString() + ")";
         con.ExecuteUpdate(query);
     } catch (Exception ex) {
         MessageBox.Show(null, ex.ToString(), "An exception occured", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }