I would appreciate any advice to resolve this problem.
I m not a pro developer but a "hobbyist" who has "inherited" a reporting job (thanks to my interest in programming - classic example of never volunteer !).
I m trying to access an Oracle 10g database from C#.
To keep things as simple as possible I ve got a bare WPF form with a single button.
Inside the click event of the button, I ve got the following code (which, incidentally worked fine in an earlier program set up on a different PC) -
using System.Data;
using System.Data.OracleClient;
...
string oraStr1 = "Data Source=(DESCRIPTION=(ADDRESS_LIST =(ADDRESS=(PROTOCOL=TCP)(HOST=myHost)(PORT=myPort)))(CONNECT_DATA=(SERVICE_NAME=myDB)));Password=myPassword;User ID=myUser;";
DataTable oraTable = new DataTable();
string queryString = "Select surname,forenames from person table where surname = Smith ";
using ( OracleConnection oraConnect = new OracleConnection( oraStr1 ) )
{
try
{
OracleCommand OraCmd = new OracleCommand( queryString, oraConnect );
oraConnect.Open();
OracleDataAdapter OraAdapter = new OracleDataAdapter();
OraAdapter.SelectCommand = OraCmd;
OraAdapter.Fill( oraTable );
}
finally
{
oraConnect.Close();
}
Now... the (C# Express Edition) application is running in a VM on a remote server. My share on this VM has also had Oracle Database 10g Client Release 2 (10.2.0.1.0) installed.
此外,还有信息技术安装的Oracle数据存取部分。
邮管处管理ODBCAD32时,没有任何骨质司机被列入名单。
我认为,安装的司机已经失败,这阻碍了我的方案启动任何联系。 然而,我没有证据,并想知道这里的学到的人能否就获得任何东西提出建议?
民主选举学会错误信息的头几个行文如下:
System.Exception was unhandled
Message="OCIEnvCreate failed with return code -1 but error message text was not available."
Source="System.Data.OracleClient"
StackTrace:
at System.Data.OracleClient.OciHandle..ctor(OciHandle parentHandle, HTYPE handleType, MODE ocimode, HANDLEFLAG handleflags)
at System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName)
at System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions)
at System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OracleClient.OracleConnection.Open()
工作寿命要长,但正如你能够看到的那样,这种安排相当复杂......
我没有资格告诉信息技术公司的工作,但会欣赏我能够接过的任何<><>>