SqlRecord

  • Thread starter Thread starter Sahil Malik
  • Start date Start date
Sahil,
ExecuteRow and SqlRecord are both obsolete in the latest CTP. I believe that
this is the correct decision going forward, please let me know if you have
any specific concerns.

The biggest benefit from these classes was the ability to have code like
this:

connection.open
sqlrecord1 = command executerow //this does not block command execution
command.execute//some other statement.

this can be easily replaced by

sqldatareader = command.executereader(CommandBehavior.SingleRow) //this
_does_ block command execution
cache data in reader and close reader // you need to save the data and close
the reader manually now.
command.execute //some other statement.

In effect ado.net was giving you a convenient way to cache the SingleRow
datareader data, not really something we should be in the business of doing
(and not necesarily something we are good at).

--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging about ADO.NET: http://weblogs.asp.net/angelsb/
 
Thank you Angel :), I was going to mention this in my book, but now I'll
just take it out. I did mention however that ExecuteRow and
ExecuteReader(CommandBehavior.SingleRow) has another difference - Multiple
result sets (one row from each).

- Sahil Malik
http://codebetter.com/blogs/sahil.malik/



Angel Saenz-Badillos said:
Sahil,
ExecuteRow and SqlRecord are both obsolete in the latest CTP. I believe that
this is the correct decision going forward, please let me know if you have
any specific concerns.

The biggest benefit from these classes was the ability to have code like
this:

connection.open
sqlrecord1 = command executerow //this does not block command execution
command.execute//some other statement.

this can be easily replaced by

sqldatareader = command.executereader(CommandBehavior.SingleRow) //this
_does_ block command execution
cache data in reader and close reader // you need to save the data and close
the reader manually now.
command.execute //some other statement.

In effect ado.net was giving you a convenient way to cache the SingleRow
datareader data, not really something we should be in the business of doing
(and not necesarily something we are good at).

--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging about ADO.NET: http://weblogs.asp.net/angelsb/




Sahil Malik said:
Okay I have a partial answer atleast. ExecuteRow now returns IDbRecord.

But http://msdn2.microsoft.com/library/System.data.sqlclient.sqlrecord.aspx
seems to suggest that SqlRecord is still alive and well. Where and how would
I use that class now?


- Sahil Malik
http://codebetter.com/blogs/sahil.malik/
 
Back
Top