ODP Provider configuration

ODP Provider configuration

Postby mlagasio » Tue 04 Oct 2011 15:36

Hi,

we'd need to connect to ODP provider by dotConnect Universal.
Looking to your documentation we have write

UniProvider provider = new UniProvider();
provider.ProviderName = "ODP";
provider.AssemblyName = "Oracle.DataAccess";
provider.Namespace = "Oracle.DataAccess";
provider.ParameterPlaceholder = '@';

Devart.Data.Universal.UniCommand uniCommand = new Devart.Data.Universal.UniCommand();

string connectionString =
//Oracle OleDB .Net Data provider

"Provider=ODP" +

//Username
";User Id=" + "elektra" +

//Password
";Password=" + "elektra" +

//Replace with your datasource value
";Data Source=" + "RISDB"; //+

uniCommand.Connection = new Devart.Data.Universal.UniConnection(connectionString);
uniCommand.Connection.Open();


uniCommand.CommandText = "EXEC_LISTSIMPLE_LAST_SPBIS";
uniCommand.CommandType = CommandType.StoredProcedure;
// Adding parameters
uniCommand.Parameters.Add(new UniParameter("v_RETURN_VALUE", UniDbType.Decimal, 4, ParameterDirection.Output, true, 10, 0, null, DataRowVersion.Current, null));
uniCommand.Parameters.Add(new UniParameter("v_START_DT", UniDbType.TimeStamp, 8));
uniCommand.Parameters.Add(new UniParameter("v_END_DT", UniDbType.TimeStamp, 8));
uniCommand.Parameters.Add(new UniParameter("v_LATE_DT", UniDbType.TimeStamp, 8));
uniCommand.Parameters.Add(new UniParameter("v_SITE", UniDbType.NVarChar, 10));
uniCommand.Parameters.Add(new UniParameter("v_ROOM", UniDbType.NVarChar, 10));
uniCommand.Parameters.Add(new UniParameter("v_FILTRO", UniDbType.Decimal, 4, ParameterDirection.Input, true, 10, 0, null, DataRowVersion.Current, null));
uniCommand.Parameters.Add(new UniParameter("v_cur", UniDbType.Cursor));
uniCommand.Parameters["v_cur"].Direction = ParameterDirection.Output;

uniCommand.Parameters["v_START_DT"].Value = new DateTime(2011, 9, 29, 17, 42, 00);
uniCommand.Parameters["v_END_DT"].Value = new DateTime(2011, 9, 30, 17, 42, 00);
uniCommand.Parameters["v_LATE_DT"].Value = new DateTime(2011, 8, 30, 17, 42, 00);

uniCommand.Parameters["v_SITE"].Value = "0000000002";
uniCommand.Parameters["v_ROOM"].Value = "";
uniCommand.Parameters["v_FILTRO"].Value = new UniDecimal(4);



Devart.Data.Universal.UniDataReader dataReader = uniCommand.ExecuteReader();

object obj = null;

int recCount = 0;

if (dataReader.FieldCount > 0)
{

while (dataReader.Read())
{
for (int i = 0; i < dataReader.FieldCount; i++)
obj = dataReader.GetValue(i);

recCount++;
}

}

dataReader.Close();


uniCommand.Connection.Close();

When is called ExecuteReader we have the error

"Value does not fall within the expected range."


The header of the sp are

create or replace
PROCEDURE "EXEC_LISTSIMPLE_LAST_SPBIS"
(v_RETURN_VALUE OUT number ,

v_START_DT IN TIMESTAMP DEFAULT NULL ,
v_END_DT IN TIMESTAMP DEFAULT NULL ,
v_LATE_DT IN TIMESTAMP DEFAULT NULL ,
V_SITE in nvarchar2 default null ,
V_ROOM in nvarchar2 default null ,
V_FILTRO in number default null ,
v_cur IN OUT Types.cursor_type
)
AS

What could you say to me

Best Regards
Marco Lagaso
mlagasio
 
Posts: 43
Joined: Mon 14 Mar 2011 13:42

Postby Shalex » Mon 10 Oct 2011 12:34

Thank you for your report. We have reproduced the error. We will investigate the issue and notify you about the results as soon as possible. As a workaround, please use connection via dotConnect for Oracle ("Provider=Oracle;").
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect Universal