Hi,
I am unable to connect using this code below:
Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.OleDb;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
OleDbConnection DBPIConn;
DBPIConn = new OleDbConnection();
DBPIConn.ConnectionString = "Provider=PIOLEDB.1;Data Source=SERVER NAME;Persist Security Info=True;Password=PASSWD;User ID=LOGIN";
DBPIConn.Open();
DBPIConn.Close();
}
}
}
I installed PI SDK 1.3.8 patched to 1.3.8.391 and OLEDB 3.3.0.1a (plus prerequisites of course).
The error is very strange: wrong username and password:
Code:
System.Data.OleDb.OleDbException was unhandled
Message="[PI SDK] Unable to open a session on a server. The user name and password may be incorrect. SERVER NAME"
Source="PIOLEDB"
ErrorCode=-2147467259
StackTrace:
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at ConsoleApplication1.Program.Main(String[] args) in C:\Documents and Settings\buntux\Local Settings\Application Data\Temporary Projects\ConsoleApplication1\Program.cs:line 15
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
When I manually input the user name and password using for example SDK Connection functionality I log into PI system without any issues.
Do I have to add some reference to my C# code which I wrote in VS 2k5 or maybe I need to install something more?
Thank you for your help in advance.