Data reader / Serverside cursor

  • Thread starter Thread starter rbrowning1958
  • Start date Start date
R

rbrowning1958

Hello,

New to ADO.NET so apologies in advance for repeating what I am sure
has been asked been before. I have read that a data reader is much
like a Server Side cursor. I understand this but have one questtion. I
use a SQL Command object to execute a Select statement, then a data
reader to retrieve the results one at a time. When is the result set
generated? When the command's executeReader is run? For example if my
select says something like "Select * from customers" - what happens if
other users change the customers table before my datareader has read
the results? I assume they are not part of my result set and that the
result was actually generated by the executeReader and not
incremnetally as I use the dataReader. Can someone confirm this,
please? If this is implementation dependent I'm talkign SQL Server.

Ta

Ray
 
See >>>

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

rbrowning1958 said:
Hello,

New to ADO.NET so apologies in advance for repeating what I am sure
has been asked been before. I have read that a data reader is much
like a Server Side cursor.

I understand this but have one questtion. I
use a SQL Command object to execute a Select statement, then a data
reader to retrieve the results one at a time. When is the result set
generated? When the command's executeReader is run?

For example if my
select says something like "Select * from customers" - what happens if
other users change the customers table before my datareader has read
the results? I assume they are not part of my result set and that the
result was actually generated by the executeReader and not
incremnetally as I use the dataReader. Can someone confirm this,
please? If this is implementation dependent I'm talkign SQL Server.

All of this detail boils down to the approach you take toward the design and
implementation of your shared data model. I discuss this in detail in my
book.
 
Back
Top