AnsweredAssumed Answered

Sometimes recibe Null Database from PISystem

Question asked by jarmdq on May 19, 2015
Latest reply on May 22, 2015 by dng

Hi,

 

I'm using AF SDK to develop web services connecting to the PI System and get information.

 

But sometimes my code works fine and sometimes return mi PISistems without Databases.

 

This is mi code to get the database:

private AFDatabase GetDatabase(string database)

{         

     impersonationContext = ((System.Security.Principal.WindowsIdentity)HttpContext.Current.User.Identity).Impersonate();

 

     var system = new PISystems().DefaultPISystem;

          

     return system.Databases[database];

}

 

When it doesn't work, system.Databases.Count returns zero items.

 

Any idea?

Outcomes