Page 1 of 1

HasRows bug

Posted: Thu 12 Jul 2007 09:56
by archie
Hi,

We're experiencing problems when using the UniDataReader.HasRows property. It seems to always return true even though there is no data present. The same goes for UniDataReader.Read() which returns true even when no records have been returned.

We have tested this with both SQL Server and MYSQL providers.

Here is an example with a SQL query which deliberately returns no data:

Code: Select all

string query = "SELECT * FROM TBL_ORG WHERE ORG_CODE='FOOBAR'";

UniDataReader reader = command.ExecuteReader();

if (reader.HasRows) { // <-- returns true even without data
  if (reader.Read()) { // <-- also returns true 
    reader.GetValue(0); // <-- now yields InvalidOperationException!
  }
}
Our CoreLab.UniDirect assembly version is 2.5.7.0.

Posted: Thu 12 Jul 2007 10:47
by Alexey
I've reproduced the problem with HasRows property.
Look forward to the next build.

Posted: Thu 12 Jul 2007 10:57
by archie
Great. When will this next build be released? Our implementation (migration from native data providers) and testing pretty much depends on this functionality...

Posted: Thu 12 Jul 2007 12:48
by Alexey
Hopefully, in the beginning of the next week.

Posted: Thu 12 Jul 2007 12:52
by archie
Sounds good, looking forward to it, thanks!