Hi
I am uable to connect to Oracle Database 11g (version 2.112.1.0). Getting below error.
ServerVersion = 'connection.ServerVersion' threw an exception of type 'System.InvalidOperationException'
'((Oracle.DataAccess.Client.OracleException)($exception)).DataSource' threw an exception of type 'System.NullReferenceException'
Can any one help me on this ?
Here is the sample code.
class
Program{
staticvoid Main(string[] args)
{
String conStr ="Data Source=dbname;User ID=id;Password=pwd";
TestOracleConnection(conStr);
}
publicstaticstring TestOracleConnection(string _oraConnStr)
{
OracleConnection oc =null;
try
{
oc =
newOracleConnection(_oraConnStr);
oc.Open();
return"success";
}
catch (Exception _e)
{
return _e.Message;
}
finally
{
if (oc !=null)
{
oc.Close();
oc.Dispose();
}
}
}
}
shravan