S
Sergey
what do you recommend how to fix this problem?
=======================================
OracleDataAdapter.Fill method doesn't work against Oracle
7.3 server.
An oracle error occures: ORA-01002: Fetch out of sequence.
The way to reproduce the problem:
1. Server-side script
-----------------------------------------------------
CREATE TABLE TEST
(
TESTCOL VARCHAR2(30)
)
/
insert into test (testcol) values ('123');
commit;
-----------------------------------------------------
2. Client code
using System;
using System.Data;
using System.Data.OracleClient;
namespace OracleError
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
string cnnString="Data Source=OracleServer;User
Id=USERNAME;Password=USERPASS;Enlist=false;";
string cmdText="SELECT * FROM TEST";
OracleConnection cnn=new OracleConnection(cnnString);
OracleCommand cmd=new OracleCommand();
OracleDataAdapter adp=new OracleDataAdapter(cmd);
DataSet ds=new DataSet();
cmd.Connection=cnn;
cmd.CommandText=cmdText;
try
{
cnn.Open();
adp.Fill(ds);
cnn.Close();
}
catch (System.Data.OracleClient.OracleException err)
{
System.Console.Write(err.Message);
}
}
}
}
=======================================
OracleDataAdapter.Fill method doesn't work against Oracle
7.3 server.
An oracle error occures: ORA-01002: Fetch out of sequence.
The way to reproduce the problem:
1. Server-side script
-----------------------------------------------------
CREATE TABLE TEST
(
TESTCOL VARCHAR2(30)
)
/
insert into test (testcol) values ('123');
commit;
-----------------------------------------------------
2. Client code
using System;
using System.Data;
using System.Data.OracleClient;
namespace OracleError
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
string cnnString="Data Source=OracleServer;User
Id=USERNAME;Password=USERPASS;Enlist=false;";
string cmdText="SELECT * FROM TEST";
OracleConnection cnn=new OracleConnection(cnnString);
OracleCommand cmd=new OracleCommand();
OracleDataAdapter adp=new OracleDataAdapter(cmd);
DataSet ds=new DataSet();
cmd.Connection=cnn;
cmd.CommandText=cmdText;
try
{
cnn.Open();
adp.Fill(ds);
cnn.Close();
}
catch (System.Data.OracleClient.OracleException err)
{
System.Console.Write(err.Message);
}
}
}
}