nerdexam
Microsoft

70-516 · Question #194

70-516 Question #194: Real Exam Question with Answer & Explanation

Sign in or unlock 70-516 to reveal the answer and full explanation for question #194. The question stem and answer options stay visible for context.

Question

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You create a Database Access Layer (DAL) that is database-independent. The DAL includes the following code segment. (Line numbers are included for reference only.) 01 static void ExecuteDbCommand(DbConnection connection) 02 { 03 if (connection != null){ 04 using (connection){ 05 try{ 06 connection.Open(); 07 DbCommand command = connection.CreateCommand(); 08 command.CommandText = "INSERT INTO Categories (CategoryName) VALUES ('Low Carb')"; 09 command.ExecuteNonQuery(); 10 } 11 ... 12 catch (Exception ex){ 13 Trace.WriteLine("Exception.Message: " + ex.Message); 14 } 15 } 16 } 17 } You need to log information about any error that occurs during data access. You also need to log the data provider that accesses the database. Which code segment should you insert at line 11?

Options

  • Acatch (OleDbException ex){
  • Bcatch (OleDbException ex){
  • Ccatch (DbException ex){
  • Dcatch (DbException ex){

Unlock 70-516 to see the answer

You've previewed enough free 70-516 questions. Unlock 70-516 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Full 70-516 Practice