Asp.Net/web app expert needed

profileKattie-zack
2_questions.docx

(TCO 4) Explain the purpose of a dataset and describe how to create a dataset called dsOrder in Visual Studio 2012. Assume you have the following function in the clsDataLayer class. Write the SQL command to select all rows from the tblOrder table, and write the code to fill the dataset.  public static dsOrder GetOrder(string Database) {  dsOrder DS; OleDbConnection sqlConn; OleDbDataAdapter sqlDA;   sqlConn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Database);   // Write the code here to select all rows from the tblOrder table _______________________________________________________   DS = new dsOrder();   // Write the code here to populate the dataset ________________________________________________________   return DS; } (Points : 15)

2. Discuss the importance of implementing transactions in web applications. Describe the COMMIT, and ROLLBACK command. In the following SaveEmployee function below, add code to insert the first name, last name, and pay rate into the tblEmployee table. In the database the column names are: FirstName, LastName, PayRate. Also, write the code to commit the transaction.  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 _____________________________________________________   // Add your comments here command.CommandType = CommandType.Text; command.CommandText = strSQL;   // Add your comments here command.ExecuteNonQuery();   // Write the code below to commit the transaction _______________________________________________________   // Add your comments here conn.Close();   recordSaved = true; } catch (Exception ex) { myTransaction.Rollback(); recordSaved = false; }     return recordSaved;   } (Points : 15)