Oracle ADO.Net プロバイダー (DevArt のdotConnect Universal ) で次のコードを使用しています。面白いのは、時々機能し、ほとんどの場合スローすることですDevart.Data.Oracle.OracleException: ORA-01722: invalid number
string sql = "SELECT DISTINCT B.PRICE_TIER_KEY,b.label, a.INSERT_DATE AS PriceEffectiveDate,B.PROGRAM_KEY AS PRICE_PROGRAM_KEY FROM GHX_MEMBER_TIER A INNER JOIN VHA_INT_PRICE_TIER B ON A.SRC_ID_VALUE = B.PRICE_TIER_KEY WHERE RowNum <=100";
DbProviderFactory dpf = DbProviderFactories.GetFactory(System.Configuration.ConfigurationManager.ConnectionStrings["Con_ORA_DevArt"].ProviderName);
DbConnection conn = dpf.CreateConnection();
conn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["Con_ORA_DevArt"].ConnectionString;
DbCommand dbcmd = dpf.CreateCommand();
dbcmd.Connection = conn;
//dbcmd.Connection = uniConnection1;
dbcmd.CommandText = sql;
dbcmd.CommandType = CommandType.Text;
dbcmd.CommandTimeout = 0;
DataTable table = new DataTable();
try
{
System.Data.Common.DbDataAdapter da = dpf.CreateDataAdapter();
da.SelectCommand = dbcmd;
// Fill the DataTable.
da.Fill(table);
}
catch (Exception ex)
{
throw;
}
finally
{
if (conn != null && conn.State != ConnectionState.Closed)
{
conn.Close();
conn.Dispose();
}
if (dbcmd != null)
{
dbcmd.Dispose();
}
}