Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Error message when you call the eConnect_EntryPoint method in eConnect for Microsoft Dynamics GP 10.0: "System Error"


SYMPTOMS

Consider the following scenario. You build an application in the Microsoft .NET Framework 2.0. Then, you call the eConnect_EntryPoint method in eConnect for Microsoft Dynamics GP 10.0. Currently, eConnect is part of the Developer Toolkit for Microsoft Dynamics GP. When you call the eConnect_EntryPoint method, an exception occurs, and you receive the following error message:

System Error

CAUSE

This problem occurs because the application's exception handling is configured by using the System.Exception base class. The exception that is thrown by the eConnect_EntryPoint method is an SqlException exception. Details for this kind of exception are not available through the System.Exception base class.

RESOLUTION

To resolve this problem, add a handler to the application to catch the SqlException exceptions. The following code is an example of how to do this.
catch (eConnectException ex)
{
    Console.WriteLine(ex.Message);
}
catch (System.Data.SqlClient.SqlException ex)
{
    foreach (System.Data.SqlClient.SqlError myError in ex.Errors)
    {
        Console.WriteLine(myError.Message);
    }
}
catch (System.Exception ex)
{
    Console.WriteLine(ex.Message);
} 

↑ Back to the top


Keywords: kb, kbnosurvey, kbMBSMigrate, kbMBSPartner, BemisKB943133, kbprb, kbtshoot, kbnoloc, kbnomt, kberrmsg, kbExpertiseBeginner

↑ Back to the top

Article Info
Article ID : 943133
Revision : 1
Created on : 3/7/2017
Published on : 3/7/2017
Exists online : False
Views : 65