-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Sitaraman
Message 6 in Discussion

Hi srini   Mahesh's observation and my post still holds valid.  At the same time you 
are also right!!!  Do note that the implementation of executereader of OracleCommand 
and SQLCommand differ in this behaviour(which makes sense coz the whole point of 
having different set of interfaces for different providers is to ensure optimisation 
depending on the DataProvider).     As to the reason why ur code worked in 
oracleclient and not in sqlclient(the difference is coz of the change in provider and 
NOT change in framework version) : Whereas SQLCommand's executereader calls the  
ValidateCommand function,  which throws an exception if the connection already has a 
open DataReader associated with it, the OracleCommand's executereader DOES NOT call 
validatecommand(this method does not even exist in OracleCommand class) and therefore 
does not throw an exception if the connection already has a open DataReader associated 
with it.  This is the case in the both System.Data.OracleClient, Version 1.0.3300.0 
and OracleClient System.Data.OracleClient Version1.0.5000.0.     MSDN specifically 
says     
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdataoracleclientoraclecommandclassexecutereadertopic2.asp
 : Remarks
If you expect your SQL statement to return only a single row, specifying SingleRow as 
the CommandBehavior value may improve application performance. When the CommandType 
property is set to StoredProcedure, the CommandText property should be set to the name 
of the stored procedure. The command then executes this stored procedure when you call 
ExecuteReader. The OracleDataReader supports a special mode that enables large binary 
values to be read efficiently. For more information, see the SequentialAccess setting 
for CommandBehavior. More than one OracleDataReader can be open at any given time   
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatasqlclientsqlcommandclassexecutereadertopic2.asp
 Remarks
When the CommandType property is set to StoredProcedure, the CommandText property 
should be set to the name of the stored procedure. The command executes this stored 
procedure when you call ExecuteReader. The SqlDataReader supports a special mode that 
enables large binary values to be read efficiently. For more information, see the 
SequentialAccess setting for CommandBehavior. While the SqlDataReader is in use, the 
associated SqlConnection is busy serving the SqlDataReader. While in this state, no 
other operations can be performed on the SqlConnection other than closing it. This is 
the case until you call the SqlDataReader.Close method. If the SqlDataReader is 
created with CommandBehavior set to CloseConnection, closing the SqlDataReader closes 
the connection automatically.      would appreciate any comments from the group!!!!   
hth   regards,   sr   p.s. : btw group- The implementation of these classes in mono 
seems to be different.  In the sense that both SQLCommand.executereader and 
OracleCommand.executereader do call the validate command() :).   Check out the 
executereader and validatecommand methods source code for SQLDataReader : 
http://lists.ximian.com/archives/public/mono-patches/2002-November/009812.html. (quite 
old i guess :) ) and  OracleDataReader : 
http://lists.ximian.com/archives/public/mono-patches/2003-March/015395.html    

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to