Reading data from Oracle with Microsoft Managed Data Provider For Oracle

G

Guest

Hi all!

I have a strange problem with reading the data from Oracle 8.1.7 sever with Oracle 9.2.0.1 client using Microsoft Managed Data Provider For Oracle ver. 1.0, build 1.0.3300.0 (I'm using Framework 1.0). Furthermore I have experienced that problem on Win2003 Enterprise station but not on Win2000 Server station (I don't see any extra serious differences between the two computers mentioned above)!

So, the problem looks like that:
1. You ask Oracle to give you the data this way:

OracleConnection cn = new OracleConnection(connectionString);
cn.Open();
OracleCommand cmd = cn.CreateCommand();
cmd.CommandType = CommandType.Text;
OracleDataAdapter da = new OracleDataAdapter("select nvarchar2field from testtable", cn);
DataTable dt = new DataTable();
da.Fill(dt);

or this way:

OracleConnection cn = new OracleConnection(connectionString);
cn.Open();
OracleCommand cmd = cn.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select nvarchar2field from testtable";
OracleDataReader OraReader = OraCommand.ExecuteReader();

2. You notify that strings in the recently retrieved data are corrupted beginning with some record to the end of all recordset.

The number of correctly retrieved records depends on the SQL query passed to the Oracle.

Could anyone tell me what might be the root of this problem?

Thanx,
Andrei.
 
M

Miha Markic

Hi Andrei,

The both methods are internally the same.
You might try with Oracle Data Provider and see if it is any better.
http://otn.oracle.com/tech/windows/odpnet/index.html

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com

Andrei said:
Hi all!

I have a strange problem with reading the data from Oracle 8.1.7 sever
with Oracle 9.2.0.1 client using Microsoft Managed Data Provider For Oracle
ver. 1.0, build 1.0.3300.0 (I'm using Framework 1.0). Furthermore I have
experienced that problem on Win2003 Enterprise station but not on Win2000
Server station (I don't see any extra serious differences between the two
computers mentioned above)!
So, the problem looks like that:
1. You ask Oracle to give you the data this way:

OracleConnection cn = new OracleConnection(connectionString);
cn.Open();
OracleCommand cmd = cn.CreateCommand();
cmd.CommandType = CommandType.Text;
OracleDataAdapter da = new OracleDataAdapter("select nvarchar2field from testtable", cn);
DataTable dt = new DataTable();
da.Fill(dt);

or this way:

OracleConnection cn = new OracleConnection(connectionString);
cn.Open();
OracleCommand cmd = cn.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select nvarchar2field from testtable";
OracleDataReader OraReader = OraCommand.ExecuteReader();

2. You notify that strings in the recently retrieved data are corrupted
beginning with some record to the end of all recordset.
 
G

Guest

Thanx for your reply, Miha!

I've just tried the same code over the ODP (Oracle Data Provider) and it works fine.
But I have to use MS provider in my code because of my project severe restrictions (I've experienced some bugs else while using MS provider instead of ODP but I can do nothing with it).

Could you help me somehow else? Maybe I can tune somehow Windows 2003 settings - do you remember that exactly the same code works fine on W2k Server?

Thank you again,
Andrei
 
M

Miha Markic

Hi Andrei,

Can you try .net 1.1? It has several bugs fixed.
Other than that, I wouldn't know what to look for, sorry.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

Andrei said:
Thanx for your reply, Miha!

I've just tried the same code over the ODP (Oracle Data Provider) and it works fine.
But I have to use MS provider in my code because of my project severe
restrictions (I've experienced some bugs else while using MS provider
instead of ODP but I can do nothing with it).
Could you help me somehow else? Maybe I can tune somehow Windows 2003
settings - do you remember that exactly the same code works fine on W2k
Server?
 
G

Guest

Unfortunately, I can't use Framework 1.1 for the same reason as I can't use ODP :
But thank you anyway

Andre

----- Miha Markic wrote: ----

Hi Andrei

Can you try .net 1.1? It has several bugs fixed
Other than that, I wouldn't know what to look for, sorry

--
Miha Markic - RightHand .NET consulting & software developmen
miha at rthand co

Andrei said:
Thanx for your reply, Miha works fine
But I have to use MS provider in my code because of my project sever
restrictions (I've experienced some bugs else while using MS provide
instead of ODP but I can do nothing with it)settings - do you remember that exactly the same code works fine on W2
Server
 
G

Guest

After I've performed the test of this code using ODP, I've tried the old code which uses MS provider - it magically began to work correctly! I guess the clue is that I have patched my Oracle client 9.2.0.1 to 9.2.0.4 during installation of ODP.

Andrei

----- Miha Markic wrote: -----

Hi Andrei,

The both methods are internally the same.
You might try with Oracle Data Provider and see if it is any better.
http://otn.oracle.com/tech/windows/odpnet/index.html

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com

Andrei said:
with Oracle 9.2.0.1 client using Microsoft Managed Data Provider For Oracle
ver. 1.0, build 1.0.3300.0 (I'm using Framework 1.0). Furthermore I have
experienced that problem on Win2003 Enterprise station but not on Win2000
Server station (I don't see any extra serious differences between the two
computers mentioned above)!
 
M

Miha Markic

Hehe, Oracle healing capability then.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

Andrei said:
After I've performed the test of this code using ODP, I've tried the old
code which uses MS provider - it magically began to work correctly! I guess
the clue is that I have patched my Oracle client 9.2.0.1 to 9.2.0.4 during
installation of ODP.
 
A

Angel Saenz-Badillos[MS]

Andrei,
I am not sure I understand the problem, but if you want to use the 1.0
version of system.data.oracleclient make sure that you have all the latest
patches from pss.

As far as data corruption, are you using unicode data? what version of the
Oracle client and what version of the server are you using? Are you using an
UTF8 encoded Oracle server?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top