The Exception Handling message box in SQL Server 2005 can be used directly with the

Source: Internet
Author: User
Tags exception handling sql string

After using a period of SQL2005, it is found that the Exception handling message box (Exceptionmessagebox) function is very good.

To copy to the Clipboard or to view detailed technical information with the appropriate help associated with it

analyzed the relevant files and found that this feature is included in the C:Program FilesMicrosoft SQL The Microsoft.NetEnterpriseServers.ExceptionMessageBox.dll in the server90shared directory can be referenced directly in the. NET project, as the following example is invoked:

Example 1

try
{
  string[] aa = new string[1];
  aa[1] = "数组越界哈";
}
catch (Exception ex)
{
  ExceptionMessageBox box1 = new ExceptionMessageBox(ex);
  box1.Show(this);
}

Example 2

ExceptionMessageBox box1 = new ExceptionMessageBox("一个简单的问题,你确认执行操作么?");
box1.Symbol = ExceptionMessageBoxSymbol.Question;
box1.Buttons = ExceptionMessageBoxButtons.YesNo;
box1.Caption = "问一下啊";
DialogResult dr = box1.Show(this);
string msg = string.Empty;
switch (dr)
{
  case DialogResult.Yes:
    msg = "你选择了【是】";
    break;
  case DialogResult.No:
    msg = "你选择了【否】";
    break;
}
MessageBox.Show(msg);

In addition, you should also put C:Program FilesMicrosoft SQL Server90sharedzh-chs under the Microsoft.NetEnterpriseServers.ExceptionMessageBox.resources.dll handcuffs out, this is the corresponding Simplified Chinese resources



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.