DataReader, Update the same reading row ?

  • Thread starter Thread starter Aruna Tennakoon
  • Start date Start date
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
 
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!
***************************
 
Back
Top