Bug

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
MarcelCH
Posts: 1
Joined: Tue 23 Aug 2005 16:59

Bug

Post by MarcelCH » Tue 23 Aug 2005 17:14

I want know if sql statement is a select, and for this I use ExecuteNonQuery() command, because for UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command. For all other types of statements, the return value is -1.
OracleConnection con=null;
try
{
string sql = "select * from cl_funcionario";
con = new OracleConnection("User Id=scott;Password=tiger;SID=ORCL;Direct=true;Server=localhost");
OracleCommand cmd = new OracleCommand(sql, con);
cmd.Connection.Open();
cmd.CommandType = CommandType.Text;
int ret = cmd.ExecuteNonQuery();
}
finally
{

con.Close();
}

ret should have -1 by ret=0

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Mon 29 Aug 2005 06:48

We reproduced your problem and fixed it. This fix will be included in the next OraDirect .NET build.

Post Reply