DataReader works even if the SQLServer is shutdown.

  • Thread starter Nimmagadda Ramakrishna via .NET 247
  • Start date
N

Nimmagadda Ramakrishna via .NET 247

Hi,
I was thinking that the SQLDataReader should not work if there isno connection to the SQLServer.
We experimented the scenario but looks like after we execute theExecuteReader method, in the debub mode on VS.NET , we thenshutdown the SQLServer 2000. Then we tried to iterate throughthe DataReader and what I expected was an exception. But whatactually happened was that it gave me the results one after theother. Ideally the DataReader should read one row at a time fromthe stream that gets connected to the DB server and which shouldthrow an exception if we shutdown the DB server right ?
What is it that I am missing here.

Is it that the stream is opened with another class on theDB-server side which caches the rows when the Stored Procedureis executed ? And so the SQLDatatReader actually makes aconnection to that class and not the server per se ?

Please clarify this.
Thanks in advance.
Have a nice day.

Regards,
Kris
 
P

Patrice

I saw a similar thread once. From our findings, the data reader uses
actually a buffer.

Patrice
--

"Nimmagadda Ramakrishna via .NET 247" <[email protected]> a écrit dans
le message de Hi,
I was thinking that the SQLDataReader should not work if there is no
connection to the SQLServer.
We experimented the scenario but looks like after we execute the
ExecuteReader method, in the debub mode on VS.NET , we then shutdown the
SQLServer 2000. Then we tried to iterate through the DataReader and what I
expected was an exception. But what actually happened was that it gave me
the results one after the other. Ideally the DataReader should read one row
at a time from the stream that gets connected to the DB server and which
should throw an exception if we shutdown the DB server right ?
What is it that I am missing here.

Is it that the stream is opened with another class on the DB-server side
which caches the rows when the Stored Procedure is executed ? And so the
SQLDatatReader actually makes a connection to that class and not the server
per se ?

Please clarify this.
Thanks in advance.
Have a nice day.

Regards,
Kris
 

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