DataReader, Update the same reading row ?

A

Aruna Tennakoon

Hi everyone,

I have a small problem, I am reading the data using the datareader. and I
want to update the same row later using a different connection and a
transaction. When I update the same row which is currently loaded to the
datareader it blocks the whole thing and waits.. ?

how do i update a data row which is currently read by the datareader ?


thanks,
-Aruna
 
G

Guest

DataReaders are designed as "fast forward" cursors. You are supposed to get
the data and put it somewhere else and then dump the DataReader. You are NOT
supposed to leave them open for any length of time. If you need to churn data
for awhile, either put the data in some form of container (could be memory)
or use a DataSet (a persistent container of sorts).

If you follow this advise, you will never have the problems you are
experiencing.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

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