sqldatareader compare to server side read only cursor in ado

Z

z f

Hi,

SqlDataReader must be connected to the database in order to bring data.
this is like server side cursor read only in ado.

the point is that in the SQL Profiler, when my code is running over the
records in ado recordset with server side cursor, i see SQL activity for
each move in the record.
in SqlDataReader i don't see the same activity in the profiler for each
record.

can someone explane why is the difference and is the DataReader really a
server side cursor?

TIA, z.
 
W

William \(Bill\) Vaughn

No, the DataReader is not a cursor at all. It is the raw data feed from the
server. A server-side cursor builds a keyset on the server (in stages) and
permits scrolling through the rowset (the query product). A DataReader
simply passes the product rowset to the client one chunk at a time as
quickly as the client can ask for rows. It is not scrollable or restartable.


--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top