I have installed Oracle client version 10g on my PC(Registry ORACLE_BASE-D:\oracle\product\10.2.0).
I have added below references.
System.Data.OracleClient.
I am getting above mentioned error.
Below is the Code Snippet .
public static OracleConnection getConnection()
{
try
{
dataSource = new SqlDataSource();
dataSource.ConnectionString = System.Configuration.ConfigurationManager.AppSettings.Get("conn");
OracleConnection connection = new OracleConnection();
if (dataSource == null)
{
// Error during initialization of InitialContext or Datasource
throw new Exception("###### Fatal Exception ###### - DataSource is not initialized.Pls check the stdout/logs.");
}
else
{
connection.ConnectionString = dataSource.ConnectionString;
connection.Open();
}
return connection;
}catch (Exception ex)
{
throw ex;
}
}
Please let me know what are the areas of Concern and where Iam missing.I am new for the combination of Oracle and Asp.Net.
Best Answer
It looks like you are using the Microsoft oracle client. I suggest that you use the ODP.net driver as it is much more reliable. (I believe the Microsoft client is being deprecated also?)
http://www.oracle.com/technetwork/topics/dotnet/index-085163.html
Install the ODP.net driver, add a reference to Oracle.DataAccess in your project, and you are good to go! Example code (from my previous post):
EDIT: I also encountered the "requires Oracle client software version 8.1.7 or greater" error before. I was caused by installing the Oracle Client onto my computer. You may try uninstalling the Oracle Client (ironically) from your computer if you are set on using the Microsoft driver.