Exception Message Box Programming


The exception message box is a programmatic interface that is installed with and used by Microsoft SQL Server graphical components. The exception message box is a supported managed assembly that you can use in your applications to provide significantly more control over the messaging experience and to give your users the options to save error message content for later reference and to get help on messages. Because the exception message box is installed by all editions of SQL Server except SQL Server Compact, you can use it with no additional configuration on any computer on which SQL Server client components have been installed.

The ExceptionMessageBox class in the Microsoft.SqlServer.MessageBox namespace has all the functionality of the MessageBox class and more. Ideal for any tasks for which MessageBox may be used, ExceptionMessageBox is designed to elegantly handle managed code exceptions. The exception message box allows you to do the following:

  • Provide customized button text for up to five buttons. Buttons and the dialog box resize automatically for different text lengths.

  • Allow users to easily copy the message title, text, button text, and help links (if any) to the Clipboard or send this information in an e-mail message.

  • Display all underlying exceptions and errors in a hierarchical relationship tree when users click Additional Information.

  • Allow users to decide whether to display the message when the same exception occurs again.

  • Access an online help system by using a help link associated with the exception.

For more information, see Program Exception Message Box.