New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with HasRows on FbDataReader [DNET305] #317
Comments
Commented by: Steven Harris (stevenharris) Workaround: However, according to MSDN documentation on HasRows:: Gets a value that indicates whether the DataTableReader contains one or more rows. Also it says... Taken From: |
Commented by: @cincuranet Firebird protocol has no support for this. Until you actually ask for some data. Hence the property returns true for all selects. |
Commented by: Ruslan Valishin (v0d01ey) Hello! |
Commented by: @cincuranet Then you still don't know whether there's more. |
Commented by: bluish (bluish) I agree that this method should be implemented. |
Commented by: @cincuranet Maybe better to throw NotSupportedException. Fine with me. But that would be a breaking change, hence would need to go to major version. Feel free to create a new item in tracker for that, if you feel like. |
Submitted by: Steven Harris (stevenharris)
Should the HasRows property return true if a datareader has no rows?
I can execute a query such as "select cus_id, cus_code, cus_name from customer where cus_id = -1" and although there is no row with a cus_id of -1, the HasRows property returns true.
Of course, when I do the dr.Read() and then dr.GetString(1) an exception occurs:
"There are no data to read"
I thought the HasRows property should indicate if there are rows to be read. Otherwise the only way I can use it is to set up a try / catch structure which seems incorrect.
The text was updated successfully, but these errors were encountered: