Skip to content

HasRows return value is inconsistent #348

@bgrainger

Description

@bgrainger

@jovana writes (split from #327):

I want to add something to the HasRows property.
I found a very strange behavior.

The value of MySqlDataReader.HasRows has changed the moment you request the value of the property. In my opinion it should always the same, right? It seems like it only changed the first and second time you request the value.

Dim rs As MySqlDataReader = cmd.ExecuteReader
Dim HasRows As Boolean
HasRows = rs.HasRows    ' <-- this will returns True (this is good)
HasRows = rs.HasRows    ' <-- this will returns False (why, what is changed on the first call?)
HasRows = rs.HasRows    ' <-- this will returns True (again, this is good)
HasRows = rs.HasRows    ' <-- this will returns True (again, now it keeps True al the checkes)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions