New Year Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: simple70

GIAC GIAC Secure Software Programmer - C#.NET GSSP-NET-CSHARP Question # 76 Topic 8 Discussion

GIAC GIAC Secure Software Programmer - C#.NET GSSP-NET-CSHARP Question # 76 Topic 8 Discussion

GSSP-NET-CSHARP Exam Topic 8 Question 76 Discussion:
Question #: 76
Topic #: 8

Allen works as a Software Developer for Mansoft Inc. He develops an application using Visual Studio .NET 2005. The application connects to a SQL Server database using a SqlConnection object named NewConnection. Allen creates a few stored procedures in the database. Sometimes an error occurs, when a user executes stored procedures. Allen wants to add an error-handling code to the application to handle errors that occur on executing stored procedures. Which of the following code segments will he use to accomplish this task?


A.

try

{

NewConnection.Open();

}

catch(DBConcurrencyException exep)

{

//Error-handling code

}


B.

try

{

NewConnection.Open();

}

catch(SqlException exep)

{

//Error-handling code

}


C.

try

{

NewConnection.Open();

}

catch(DataException exep)

{

//Error-handling code

}


D.

try

{

NewConnection.Open();

}

catch(InvalidCastException exep)

{

//Error-handling code

}


Get Premium GSSP-NET-CSHARP Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.