OracleDataSourceEnumerator Bug
Posted: Tue 27 Oct 2015 14:21
Hello,
I am trying to read the tnsnames.ora entries using the following code copied from the example on your website:
OracleHomeCollection homes = OracleConnection.Homes;
foreach (OracleHome h in homes)
{
Console.WriteLine("=== Home={0} ===", h.Name);
OracleDataSourceEnumerator en = new OracleDataSourceEnumerator();
DataTable tbl = en.GetDataSources(h.Name);
foreach (DataRow row in tbl.Rows)
{
Console.WriteLine(row["InstanceName"]);
}
}
The problem is that every column in the DataTable is empty except InstanceName. I have tested if I can connect with the alias and it works. Also, using ODP.NET I am able to see the entries in full detail. The code for ODP.NET to read tnsnames.ora entries is the following:
string ProviderName = "Oracle.DataAccess.Client";
DbProviderFactory factory = DbProviderFactories.GetFactory(ProviderName);
if (factory.CanCreateDataSourceEnumerator)
{
DbDataSourceEnumerator dsenum = factory.CreateDataSourceEnumerator();
DataTable dt = dsenum.GetDataSources();
foreach (DataRow row in dt.Rows)
{
System.Diagnostics.Debug.Print(dt.Columns[0] + " : " + row[0]);
System.Diagnostics.Debug.Print(dt.Columns[1] + " : " + row[1]);
System.Diagnostics.Debug.Print(dt.Columns[2] + " : " + row[2]);
System.Diagnostics.Debug.Print(dt.Columns[3] + " : " + row[3]);
System.Diagnostics.Debug.Print(dt.Columns[4] + " : " + row[4]);
System.Diagnostics.Debug.Print("--------------------");
}
}
else
Console.Write("Data source enumeration is not supported by provider");
Can you help me by answering this blocking issue?
We have dotConnect 8.3.135.0
We use Oracle 11g
Thanks,
I am trying to read the tnsnames.ora entries using the following code copied from the example on your website:
OracleHomeCollection homes = OracleConnection.Homes;
foreach (OracleHome h in homes)
{
Console.WriteLine("=== Home={0} ===", h.Name);
OracleDataSourceEnumerator en = new OracleDataSourceEnumerator();
DataTable tbl = en.GetDataSources(h.Name);
foreach (DataRow row in tbl.Rows)
{
Console.WriteLine(row["InstanceName"]);
}
}
The problem is that every column in the DataTable is empty except InstanceName. I have tested if I can connect with the alias and it works. Also, using ODP.NET I am able to see the entries in full detail. The code for ODP.NET to read tnsnames.ora entries is the following:
string ProviderName = "Oracle.DataAccess.Client";
DbProviderFactory factory = DbProviderFactories.GetFactory(ProviderName);
if (factory.CanCreateDataSourceEnumerator)
{
DbDataSourceEnumerator dsenum = factory.CreateDataSourceEnumerator();
DataTable dt = dsenum.GetDataSources();
foreach (DataRow row in dt.Rows)
{
System.Diagnostics.Debug.Print(dt.Columns[0] + " : " + row[0]);
System.Diagnostics.Debug.Print(dt.Columns[1] + " : " + row[1]);
System.Diagnostics.Debug.Print(dt.Columns[2] + " : " + row[2]);
System.Diagnostics.Debug.Print(dt.Columns[3] + " : " + row[3]);
System.Diagnostics.Debug.Print(dt.Columns[4] + " : " + row[4]);
System.Diagnostics.Debug.Print("--------------------");
}
}
else
Console.Write("Data source enumeration is not supported by provider");
Can you help me by answering this blocking issue?
We have dotConnect 8.3.135.0
We use Oracle 11g
Thanks,