[Mono-devel-list] How to implement SqlDataReader - HasRow .

Francisco Figueiredo Jr. fxjrlists at yahoo.com.br
Sat Mar 13 09:04:07 EST 2004

S Umadevi wrote:
> Hi


>   The HasRow method on SqlDataReader returns whether the DataReader has
> one or more rows. But it DOES NOT read the Row. It is supposed to be
> used as a mechanism to check whether Read can be called. (even though it
> sounds redundant!)


> Now to implement this,  I will need a mechanism to peek into the
> TdsPacket/buffer  and still not read it into the currentRow object of
> the Tds class in Mono.Tds.TdsProtocol. Because if we call a read
> immediately, we need to read the CurrentRow.

I can be completely wrong, but I think the idea of hasrow doesn't read 
the row is just a matter of it not increment the row cursor in the 
datareader so the client still can get the row. So, I think you could 
read the row normally as you do now and just return if there is a row to 
be read or not.

I hope it helps.


Francisco Figueiredo Jr.
Membro Fundador do Projeto MonoBrasil - MonoBrasil Project Founder Member

"Science without religion is lame;
religion without science is blind."

                   ~ Albert Einstein

More information about the Mono-devel-list mailing list