To provide isolation between programs accessing a

This preview shows page 9 - 11 out of 11 pages.

>> To provide isolation between programs accessing a database concurrently. If this isolation is not provided, the program's outcome is possibly erroneous. Two of the major transaction types are COMMIT and ROLLBACK, these are used for specific purposes andtimes when working with databases. The COMMIT command is the transactional command used to save changes made by a transaction to the database. The COMMIT command will save all changes to the database since the last COMMIT or ROLLBACK command. The ROLLBACK command on the other hand, mainly undo the transactions that have not already been committed to the database. The ROLLBACK command can be issued to undo the changes since the last COMMIT or ROLLBACK.public static bool SaveEmployee(string Database, string FirstName, string LastName, string PayRate){bool recordSaved;try
{OleDbTransaction myTransaction = null;OleDbConnection conn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" +"Data Source=" +Database);conn.Open();OleDbCommand command = conn.CreateCommand();string strSQL;myTransaction = conn.BeginTransaction();command.Transaction = myTransaction;// Write the code below to insert the first name, last name, and pay rate into the tblEmployee table_____________________________________________________// insert statement declaration for data insert to databasestrSQL = "Insert into tblEmployee " +"(FirstName, LastName, PayRate) values ('" +FirstName + "', '" + LastName + "', '" + PayRate + "')";// preparation of sql statement for executioncommand.CommandType = CommandType.Text;command.CommandText = strSQL;// execution of insert statement for data addition to databasecommand.ExecuteNonQuery();// Write the code below to commit the transaction_______________________________________________________// commitment of transaction to databasemyTransaction.Commit();// closing open database connectionconn.Close();recordSaved = true;}catch (Exception ex){myTransaction.Rollback();recordSaved = false;}return recordSaved;
Question 5. 5. (TCO 8, 9) Discuss authorization and authentication and explain forms-based-authentication. Describe the use of the ControlToValidate, Validation expression, ErrorMessage, and Enabled properties of a validation control. (Points : 15)

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture