ChewCheeLim

How to retrieve AF DB a user is authorized to work with in AF SDK?

Discussion created by ChewCheeLim on Aug 28, 2012
Latest reply on Aug 29, 2012 by ChewCheeLim

Hi, How to retrieve AF DB a user is authorized to work with in AF SDK?

 

I had set up a user account to see only 1 AF db on my system.

 

I am using the below code snippet to connect to the AF Server.

 
piSystem.Connect(new NetworkCredential(sUser, sPassword));

 

 

I am pretty sure the user has access to a single DB by testing out using PI System Explorer tool. But when I execute this line of code, it erred out with the following error message.

 

+  [System.ServiceModel.CommunicationException] {"Cannot connect to server 'ENERGYMETRICSLL'."} System.ServiceModel.CommunicationException
+  InnerException {"The server has rejected the client credentials."} System.Exception {System.ServiceModel.Security.SecurityNegotiationException}

 

How can i fix this?

Outcomes