session.CompanyList() returns empty list

Hi,

I have Sage 50 premium 2016 installed in two machines with the company file residing in one of them. I can open the company from both computers without any problem using The local Sage50, in one machine it opens it from c:\sage\peachtree\company\elXXX and in the other it opens it from a network drive (k:\elXXX ). The problem I have is that from the remote machine I cannot access the company from the SDK (even as the company is open in Sage50)

This is my code:

var session = new PeachtreeSession();

session.Begin(appKeyID);

foreach (CompanyIdentifier ci in session.CompanyList())
{
Logger.Log("CompanyName: " + ci.CompanyName);
Logger.Log("DatabaseName: " + ci.DatabaseName);
Logger.Log("Path: " + ci.Path);
Logger.Log("ServerName: " + ci.ServerName);
}

and the problem is that CompanyList() is empty.

What can I do in this case?

Thank,

Ignacio

  • 0
    Take a look at the sample code in Sage 50 2016.0 SDK\.Net Samples\Sample Code\WinformExamples. Run this program, on the Main form click Session Manager. Put your Application Key in the top box and click Begin Session. You should see a listing of all companies that have been opened on that computer. If your company shows up then look at the code from the SessionManagerForm and modify it to your needs.
  • 0

    I ran into this same issue, just closed the client session of sage 50 and it prompted for the update, everything was back to normal after installed the update.

    I'm running into an issue with getting a Windows 10 computer to prompt for the update, just gives me an error and suggests "close program". Anyone know of a work around for this, or is there a link to a direct download for the update?