Datareader.HasRows not supported ?
How come the Datareader.Hasrows function doesnt work unless you set Its contents Scrollable how do i read through the datareader effectively ?
I've been using Datareader.read = false if its empty and after that read one record.
How do i check if there's more then one record in it and go through it ?
Ive tried , While Datareader.read
or Do while Datareader.read
but it ends without reading anything , while i know it has something.
Re: Datareader.HasRows not supported ?
I can't look anything up, but I always use a loop for datareaders:
Do while DataReader.Read
(at least I'm pretty sure I do).
Since that is what you are doing, then it sure looks like there is something else going wrong. You say that you know there is something there, but every test you are trying seems to indicate that there actually isn't. How do you know that there is something?
How about running the same query as ExecuteScalar, and see whether you get something back. It sure seems like the DataReader part is not the problem.
Re: Datareader.HasRows not supported ?
i always use for multiple items
While l_datareader.Reader
'do whatever
End WHile
and for a single item return
If l_datareader.Read
End If
Re: Datareader.HasRows not supported ?
Still should have worked. The loop ending without reading anything strongly suggests that the reader is empty.
Re: Datareader.HasRows not supported ?
The funny thing is that datareader.executeresultset Does give me 2 or 3 items.
and i have to set the resulsetoptions.scrollable , its very strange.
Re: Datareader.HasRows not supported ?
That is strange. I have never had that problem, nor have I ever used ExecuteResultSet, but that sure makes me suspicious. I have no access to much of anything at the moment, and won't until tomorrow, but that method makes me think that you are creating the datareader in a way that is different from what I am expecting.
Re: Datareader.HasRows not supported ?
the Do while datareader.read works now, but with executeresultset though