What should you do to automatically rollback the installation is the component throws a SqlException instance?

You are working as an application developer at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. Domain.com uses Visual Studio 2005 as an application platform. You as the developer of Domain.com use a client computer named Certkiller -WS209 as developing collateral.
You are busy creating a class that derives from Installer. The class that you created is used by Microsoft Windows Forms setup application to install a custom component which uses an existing Microsoft SQL Server 2005 database. The component throws a SqlException instance when it cannot connect to the database during installation.
What should you do to automatically rollback the installation is the component throws a SqlException instance?

You are working as an application developer at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. Domain.com uses Visual Studio 2005 as an application platform. You as the developer of Domain.com use a client computer named Certkiller -WS209 as developing collateral.

You are busy creating a class that derives from Installer. The class that you created is used by Microsoft Windows Forms setup application to install a custom component which uses an existing Microsoft SQL Server 2005 database. The component throws a SqlException instance when it cannot connect to the database during installation.

What should you do to automatically rollback the installation is the component throws a SqlException instance?

A.
You should catch the SqlException instance and create an instance of InstallException and pass the SqlException instance as the inner exception and then throw the InstallException instance.

B.
You should catch the SqlException instance and create an instance of ApplicationException and pass the SqlException instance as the inner exception and then throw the ApplicationException instance.

C.
You should catch the SqlException instance and re-throw it.

D.
You do not nee to catch the SqlException instance as it will propagate up the call stack.

Explanation:
This action will pass information to the Microsoft Windows Installer and causes the installation to be rolled back.

Incorrect Answers:
B: The ApplicationException will not cause the installation to roll back.
C: The SqlException will not cause the installation to roll back.
D: The FileNtFoundException will not cause the installation to roll back.



Leave a Reply 0

Your email address will not be published. Required fields are marked *