Cis 407 ilab 5 of 7: transaction processing

    // This function saves the personnel data
    public static bool SavePersonnel(string Database, string FirstName, string LastName,
                                     string PayRate, string StartDate, string EndDate)
    {
        bool recordSaved;

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

          // ** NEW ** Add your comments here
          OleDbTransaction myTransaction = null;

        try
        {

            // Add your comments here
            OleDbConnection conn = new OleDbConnection(“PROVIDER=Microsoft.Jet.OLEDB.4.0;” +
                                                       “Data Source=” + Database);
            conn.Open();
            OleDbCommand command = conn.CreateCommand();
            string strSQL;

            // ** NEW ** Add your comments here
            myTransaction = conn.BeginTransaction();
               command.Transaction = myTransaction;

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

            // Add your comments here
            strSQL = “Insert into tblPersonnel ” +
                     “(FirstName, LastName) values (‘” +
                     FirstName + “‘, ‘” + LastName + “‘)”;

            // Add your comments here
            command.CommandType = CommandType.Text;
            command.CommandText = strSQL;

            // Add your comments here
            command.ExecuteNonQuery();

            // Add your comments here
            strSQL = “Update tblPersonnel ” +
                     “Set PayRate=” + PayRate + “, ” +
                     “StartDate=”” + StartDate + “”, ” +
                     “EndDate=”” + EndDate + “” ” +
                     “Where ID=(Select Max(ID) From tblPersonnel)”;

            // Add your comments here
            command.CommandType = CommandType.Text;
            command.CommandText = strSQL;

            // Add your comments here
            command.ExecuteNonQuery();

            // ** NEW ** Add your comments here
            myTransaction.Commit();

            // Add your comments here
            conn.Close();

            recordSaved = true;

        }
        catch (Exception ex)
        {

            // ** NEW ** Add your comments here
            myTransaction.Rollback();
            
            recordSaved = false;

        }

        return recordSaved;

    }

Calculate your order
Pages (275 words)
Standard price: $0.00
Client Reviews
4.9
Sitejabber
4.6
Trustpilot
4.8
Our Guarantees
100% Confidentiality
Information about customers is confidential and never disclosed to third parties.
Original Writing
We complete all papers from scratch. You can get a plagiarism report.
Timely Delivery
No missed deadlines – 97% of assignments are completed in time.
Money Back
If you're confident that a writer didn't follow your order details, ask for a refund.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Power up Your Academic Success with the
Team of Professionals. We’ve Got Your Back.
Power up Your Study Success with Experts We’ve Got Your Back.
Open chat
1
Order through WhatsApp!
nursingesssayswritings.com
Hello!
You Can Now Place your Order through WhatsApp

Order your essay today and save 30% with the discount code ESSAYHELP2