Search found 43 matches

by mlagasio
Wed 15 Jan 2014 15:51
Forum: dotConnect Universal
Topic: EnlistTransaction
Replies: 1
Views: 1965

EnlistTransaction

Hi,

I'm using 3.20.59 Pro. If I open a uniconnection vs SqlServer, instance a transactionscope

when call uniconnection.EnlistTransaction(Transaction.Current)

an exception raises: the method is not implemented.

many thanks in advance

Best regards
Marco Lagasio
by mlagasio
Tue 20 Nov 2012 13:08
Forum: dotConnect Universal
Topic: Call to Oracle stored procedure by UniCommand
Replies: 3
Views: 2176

Re: Call to Oracle stored procedure by UniCommand

I use dotconnect Universal 3.20.59

Regards
by mlagasio
Tue 20 Nov 2012 13:03
Forum: dotConnect Universal
Topic: Call to Oracle stored procedure by UniCommand
Replies: 3
Views: 2176

Call to Oracle stored procedure by UniCommand

Hi,

I've seen (by UniMonitor) that if I call an Oracle Procedure by UniCommand there is an (implicit) Open Connection to db when define parameters before the moment I open explicitly the connection from c# (with connection.Open).

Could you confirm this?. Why?

Best Regards, Marco
by mlagasio
Wed 14 Nov 2012 08:35
Forum: Entity Developer
Topic: Not mapped properties
Replies: 1
Views: 1166

Not mapped properties

Hi

is it possible to add a not mapped property to an Entity class?
My need is to load by instances of this class a view that has not a primary key.
So I think to create it artificially by the not mapped property.

Best Regards
Marco
by mlagasio
Fri 02 Mar 2012 13:41
Forum: dotConnect Universal
Topic: NCLOB problem
Replies: 3
Views: 2061

NCLOB problem

Hi,

If I call the SP Oracle

CREATE OR REPLACE PROCEDURE "TESTCLOB" (
v_PARAMETER IN NCLOB ,
v_Out OUT NCLOB
)
AS
V_P NCLOB := v_PARAMETER;
BEGIN

v_Out := REPLACE(V_P, '@', TO_NCLOB(10));

END TESTCLOB;

with the code

UniConnection conn = new UniConnection("Data Source=RISDB;User ID=IMARKDB;Password=IMUser;");

// Prepara la query
UniCommand cmd = new UniCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "TESTCLOB";

UniParameter par = cmd.Parameters.Add(new UniParameter("v_PARAMETER", UniDbType.NClob, 8000));
par.Value = "Pippo@Pluto";

UniParameter par1 = cmd.Parameters.Add(new UniParameter("v_Out", OracleDbType.NClob, 8000));
par1.Direction = ParameterDirection.Output;


conn.Open();



UniDataReader reader = null;
try
{
reader = cmd.ExecuteReader();
}
finally
{
reader.Close();
conn.Close();
}

then I have the error

ORA-22921 length of input buffer is smaller than amount requested
ORA-06512: a "IMARKDB.TESTCLOB", line 9
ORA-06512: a line 2

If I run the script with sql-developer there are no problems.

Best Regards
Marco
by mlagasio
Mon 20 Feb 2012 10:31
Forum: dotConnect Universal
Topic: Parameter from UniMonitor instance
Replies: 1
Views: 1762

Parameter from UniMonitor instance

Hi,

is it possible to obtain parameters (Name and Values) from TraceEvent handler of an UniMonitor instance (like from dbMonitor) connecting to Oracle?

Many thanks in advance

Marco
by mlagasio
Wed 02 Nov 2011 08:49
Forum: dotConnect Universal
Topic: UniParameter positional or not
Replies: 9
Views: 2367

Excuse me. I'll try to clarify my post.

There is no reference to request to your support in my post.

1) I think surprising that after I migrate an entire business application to SqlServer/Oracle from SqlServer only

-assuming positional the parameter definition in UniCommand
-using different names c# side and Oracle db side

I've never seen problems like that explained above.

Moreover

2) Before send to you my question, I've make the following test. I've call from c# by Universal an Oracle stored procedure passing to it some parameters a, b, c. In the store procedure I've assigned a, b, c to out parameters d, e, f (respectively), returned to c# application. The names of all parameters c# side are DIFFERENT from the corresponding parameter db side, but the parameter definition order is the same.
The values of the out parameters c# side are the same as in parameters.
That is

a==d
b==e
c==f

Also this surprise me with respect to your answer

I hope this is clear.

Regards
Marco
by mlagasio
Thu 27 Oct 2011 07:57
Forum: dotConnect Universal
Topic: UniParameter positional or not
Replies: 9
Views: 2367

Hi,

this is a surprise for me because

1) I've migrated to Universal an entire business application leaving the names of the parameters (c# side) the same as defined before the migration from SQL Server (the names were and are of the form @name, but Oracle db side now are of the form v_name). This assuming positional the parameter definition (c# side)

2) I've make (with Oracle) a test like this: I've modified the sp above mentioned

a) duplicating the parameter (except the cursor), but changing to the new parameters, the parameter direction to out
b) changing the sp implementation to simple assignations to out pars of in pars.

C# side (with checkparameter = false) I read out pars with correct values assigned to in pars before call the stored procedure.

Sorry for the insistence

Best Regards
Marco
by mlagasio
Mon 24 Oct 2011 12:33
Forum: dotConnect Universal
Topic: UniParameter positional or not
Replies: 9
Views: 2367

Hi,
I thank you but the misunderstanding is with the phrase in your help on parameter. Exactly

"When you invoke a stored procedure you have to create collection of parameters that corresponds strictly to set of arguments for the stored procedure in quantity and types. Names of parameters do not matter unless you set UniCommand.ParameterCheck property to true."

What could you say about?

Regards
Marco
by mlagasio
Tue 18 Oct 2011 14:28
Forum: dotConnect Universal
Topic: UniParameter positional or not
Replies: 9
Views: 2367

Hi,

I've added the parameters in the same order as in the stored procedure header. Only I've not added the last parameter (the cursor).
In my case CheckParameter = false (the default). If I name the c# parameters as the sp parameter all run fine, if I use different names all run but the row retrieved are wrong (none against 14 rows).

Where is the problem?

Best Regards
Marco
by mlagasio
Mon 10 Oct 2011 14:46
Forum: dotConnect Universal
Topic: UniParameter positional or not
Replies: 9
Views: 2367

UniParameter positional or not

Hi,

in a test application I've called a sp with the following code

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

string connectionString =
"Provider=Oracle" +

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

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

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

UniMonitor um = new UniMonitor();
um.IsActive = true;

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


uniCommand.CommandText = "WS_AMWRK_BOO_DTASC_NOLAST";
uniCommand.CommandType = CommandType.StoredProcedure;



uniCommand.Parameters.Add(new UniParameter("v_RETURN_VALUE", UniDbType.Int, 4, ParameterDirection.Output, true, 10, 0, null, DataRowVersion.Current, null));

uniCommand.Parameters.Add(new UniParameter("v_STARTDATE", UniDbType.TimeStamp, 8));
uniCommand.Parameters.Add(new UniParameter("v_ENDDATE", UniDbType.TimeStamp, 8));
uniCommand.Parameters.Add(new UniParameter("v_CSVWEEKDAYS", UniDbType.NVarChar, 100));

uniCommand.Parameters.Add(new UniParameter("v_RADIOLOGISTCODE", UniDbType.NVarChar, 10));
uniCommand.Parameters.Add(new UniParameter("v_SITECODE", UniDbType.NVarChar, 10));
uniCommand.Parameters.Add(new UniParameter("v_ROOMCODE", UniDbType.NVarChar, 10));
uniCommand.Parameters.Add(new UniParameter("v_MODALITYCODE", UniDbType.NVarChar, 10));
uniCommand.Parameters.Add(new UniParameter("v_ORIGINTYPECODE", UniDbType.NVarChar, 10));
uniCommand.Parameters.Add(new UniParameter("v_PRIORITYCODE", UniDbType.VarChar, 10));

uniCommand.Parameters.Add(new UniParameter("v_STATUS", UniDbType.Int, 4));


uniCommand.Parameters["v_STARTDATE"].Value = new DateTime(2011, 7, 14, 0, 0, 0);
uniCommand.Parameters["v_ENDDATE"].Value = new DateTime(2011, 7, 14, 23, 59, 00);
uniCommand.Parameters["v_STATUS"].Value = 0;
uniCommand.Parameters["v_CSVWEEKDAYS"].Value = "0,1,2,3,4,5,6";
uniCommand.Parameters["v_RADIOLOGISTCODE"].Value = DBNull.Value;
uniCommand.Parameters["v_SITECODE"].Value = DBNull.Value;
uniCommand.Parameters["v_ROOMCODE"].Value = DBNull.Value;
uniCommand.Parameters["v_MODALITYCODE"].Value = DBNull.Value;
uniCommand.Parameters["v_ORIGINTYPECODE"].Value = DBNull.Value;
uniCommand.Parameters["v_PRIORITYCODE"].Value = DBNull.Value;


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++;
}

}

MessageBox.Show(recCount.ToString());

dataReader.Close();
uniCommand.Connection.Close();
============================================

The signature of the sp is

============================================
CREATE OR REPLACE PROCEDURE "WS_AMWRK_BOO_DTASC_NOLAST"(v_RETURN_VALUE OUT number,

v_STARTDATE IN TIMESTAMP DEFAULT NULL,
v_ENDDATE IN TIMESTAMP DEFAULT NULL,
v_CSVWEEKDAYS IN NVARCHAR2 DEFAULT NULL,
v_RADIOLOGISTCODE IN NVARCHAR2 DEFAULT NULL,
v_SITECODE IN NVARCHAR2 DEFAULT NULL,
v_ROOMCODE IN NVARCHAR2 DEFAULT NULL,
v_MODALITYCODE IN NVARCHAR2 DEFAULT NULL,
v_ORIGINTYPECODE IN NVARCHAR2 DEFAULT NULL,
v_PRIORITYCODE IN NVARCHAR2 DEFAULT NULL,
v_STATUS IN NUMBER DEFAULT NULL,

v_cur IN OUT Types.cursor_type
========================================

As you could see the last sp param has not been added explicitly
to the UniCommand.Parameters collection.

Launching the application the messagebox show 14 records found.
If I change in c# code the name of the parameters substituting v_ with @ (in all places, that is adding parameter and assigning values)
then the message box return 0 records. I've leave checkParameter to false (the default).

The question is: the parameter definition is positional or not?

Many thanks

Best Regards
Marco
by mlagasio
Tue 04 Oct 2011 15:36
Forum: dotConnect Universal
Topic: ODP Provider configuration
Replies: 1
Views: 1794

ODP Provider configuration

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
by mlagasio
Thu 29 Sep 2011 10:05
Forum: dotConnect Universal
Topic: Ole Db, compatibility
Replies: 2
Views: 1436

Hi,

I've see the documentation, where you declare the compatibility.
When I refer compatibility I refer to low level (es. client 10.2.0.5)

Marco
by mlagasio
Thu 29 Sep 2011 09:59
Forum: dotConnect Universal
Topic: Ole Db, compatibility
Replies: 2
Views: 1436

Ole Db, compatibility

Hi,

1) Do I need to install Oracle ole db on my machine to use DotConnect Universal with direct connection?

2) Which are Oracle Client release and Oracle Server release compatible with DotConnect Universal 3.2.50.0 (that we use as registered users)?

Many thanks in advance.
Best Regards, Marco
by mlagasio
Mon 20 Jun 2011 06:57
Forum: dotConnect Universal
Topic: DesignTimeVisible?
Replies: 2
Views: 1837

Hi,

I would want only understand how have you made to make not accessible a public property of an ancestor class.
But perhaps I've understand.

Thank you
Marco