Page 1 of 1

Bug

Posted: Tue 23 Aug 2005 17:14
by MarcelCH
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

Posted: Mon 29 Aug 2005 06:48
by Paul
We reproduced your problem and fixed it. This fix will be included in the next OraDirect .NET build.