Like the dataset, is the datareader also a disconnected datasource? It
doesn't look like because of two reasons:

(1) It is forward only. Having a connected stream would make more sense
to reflect recent updations to the original database from other
connections of other users.

(2) It would be more performance intensive if it were to be
disconnected.

(3) It has a Close() method on it. It implies it is connected.


What's the truth?

Re: Is the DataReader disconnected? by ng

ng
Wed Aug 31 19:08:41 CDT 2005

Actually, your first point implies it is disconnected. A connected
reader would be able to go backwards also. I don't use datareader, but
your description sounds a little like the old snapshot recordset from
VB6 days.

Tom


Water Cooler v2 wrote:

>Like the dataset, is the datareader also a disconnected datasource? It
>doesn't look like because of two reasons:
>
>(1) It is forward only. Having a connected stream would make more sense
>to reflect recent updations to the original database from other
>connections of other users.
>
>(2) It would be more performance intensive if it were to be
>disconnected.
>
>(3) It has a Close() method on it. It implies it is connected.
>
>
>What's the truth?
>
>
>

Re: Is the DataReader disconnected? by William

William
Wed Aug 31 19:09:53 CDT 2005

1) It is connected. It's connected to the raw data stream being returned by
the provider as the rows are fetched. The rows fetched reflect the most
recent changes to the database tables.
2) Huh?
3) The close says "I don't need any more data from this stream. Do what's
necessary to tell the server to stop sending it"

that's the truth.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
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.
__________________________________

"Water Cooler v2" <wtr_clr@yahoo.com> wrote in message
news:1125532558.297415.153040@o13g2000cwo.googlegroups.com...
> Like the dataset, is the datareader also a disconnected datasource? It
> doesn't look like because of two reasons:
>
> (1) It is forward only. Having a connected stream would make more sense
> to reflect recent updations to the original database from other
> connections of other users.
>
> (2) It would be more performance intensive if it were to be
> disconnected.
>
> (3) It has a Close() method on it. It implies it is connected.
>
>
> What's the truth?
>



Re: Is the DataReader disconnected? by Sahil

Sahil
Wed Aug 31 20:50:34 CDT 2005

DataReader is connected.

1. That depends on the locking mechanism you are using in your query.
2. Not necessarily
3. Yes it is connected. But close on a datareader doesn't close the connect
unless you use CommandBehavior.CloseConnection.


--

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
----------------------------------------------------------------------------



"Water Cooler v2" <wtr_clr@yahoo.com> wrote in message
news:1125532558.297415.153040@o13g2000cwo.googlegroups.com...
> Like the dataset, is the datareader also a disconnected datasource? It
> doesn't look like because of two reasons:
>
> (1) It is forward only. Having a connected stream would make more sense
> to reflect recent updations to the original database from other
> connections of other users.
>
> (2) It would be more performance intensive if it were to be
> disconnected.
>
> (3) It has a Close() method on it. It implies it is connected.
>
>
> What's the truth?
>



Re: Is the DataReader disconnected? by Water

Water
Wed Aug 31 21:32:49 CDT 2005

Wow! Just wow! A reply from Bill Vaughn. I am honored.

> 2) Huh?

What I implied was that if the data reader was disconnected and had to
remember the cursor position everytime before disconnecting and then go
back and connect and reload its state/cursor position, it would be a
performance hog.


Thanks, everyone.


Re: Is the DataReader disconnected? by Cor

Cor
Thu Sep 01 02:09:01 CDT 2005

WaterCooler

> Wow! Just wow! A reply from Bill Vaughn. I am honored.
>
Of course you should be honered, however Bill is helping everybody in this
newsgroup and I never saw that he had his own selections.

Before somebody gets a wrong idea about that.

Cor