Home All Groups Group Topic Archive Search About

DataReader, Update the same reading row ?

Author
14 Jul 2006 9:40 AM
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

Author
14 Jul 2006 12:48 PM
Cowboy (Gregory A. Beamer) - MVP
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!
***************************


Show quote
"Aruna Tennakoon" wrote:

> 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
>
>
>
>

AddThis Social Bookmark Button