ATMLCommonLibrary.forms.ATMLErrorForm.ATMLErrorForm C# (CSharp) Method

ATMLErrorForm() public method

public ATMLErrorForm ( Exception e ) : System
e System.Exception
return System
        public ATMLErrorForm( Exception e )
        {
            String message = e.Message;
            InitializeComponent();
            StringBuilder sb = new StringBuilder();
            sb.Append(e.Message);
            sb.Append("\r\n");
            sb.Append(e.StackTrace).Append("\r\n\r\n");
            e = e.InnerException;
            while (e != null)
            {
                message = e.Message;
                sb.Append(e.Message);
                sb.Append("\r\n");
                sb.Append(e.StackTrace).Append("\r\n\r\n");
                e = e.InnerException;
            }

            StringBuilder htmlError = new StringBuilder();
            if (sb.ToString().Contains("'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine"))
            {
                htmlError.Append(
                    "<h2 style=\"color:red;\">The 'Microsoft.ACE.OLEDB.12.0; provider is not registered.</h2>");
                htmlError.Append(
                    "<p>The 'Microsoft.ACE.OLEDB.12.0' provider has not been registered on this machine. You may do so by visiting the <a href=\"http://www.microsoft.com/en-us/download/confirmation.aspx?id=23734\" >Microsoft web site (http://www.microsoft.com/en-us/download/confirmation.aspx?id=23734) </a>and installing the 'Microsoft.ACE.OLEDB.12.0' database engine.</p>");
            }
            else
            {
                htmlError.Append("<h2 style=\"color:red;\">").Append(message).Append("</h2>");
                htmlError.Append("<pre>").Append(sb).Append("</pre>");
            }

            webBrowser.DocumentText = htmlError.ToString();
        }

Same methods

ATMLErrorForm::ATMLErrorForm ( String title, String message, string note = null ) : System