Migrating from Classic ASP to ASP.NET - equivalent objects and classes
|Classic ASP||.NET Framework|
 In ADO.NET, the Connection object is provider specific, unlike the generic ADO Connection object
 In ADO.NET, the Command object is provider specific, unlike the generic ADO Command object
 There is no real equivalent to a RecordSet object in ADO.NET. The DataSet is a disconnected in-memory container for data, which is held in DataTables. The DataReader is akin to a forward-only, read-only RecordSet.
 Methods and collection of the Response, Request, Session, Application etc objects can be referenced in ASP.NET in exactly the same way as in Classic ASP, where the reference is within the web form derived from Page. If the flow of control leaves this area, the static property Current on the HttpContext class can be used. This can be seen where the current page's querystring values are referenced from a static method in this nugget of code for paging articles.
 ExecuteScalar returns a one row, one column result. Usually used with aggregates like SELECT Count(ID) AS TheCount. ExecuteReader is used to return a DataReader containing the records to be processed. ExecuteNonQuery is used for INSERT, UPDATE and DELETE operations where no return value is expected.
 Multiple RecordSets returned in a DataSet occupy separate DataTables. The DataTables can be iterated over using their ordinal index. The DataReader offers a NextResult method which moves to the, well, next result.
Currently rated 4.33 by 6 people
07 April 2007 10:01
Last Updated: 27 May 2007 21:21
Posted by: Mikesdotnetting
Total Views to date: 9528
Unfortunately, something went wrong and your message or comments have not been submitted successfully. I'll try to fix whatever the problem is as soon as I can.
Thanks for your comments. They have been successfully sent to me. It may take a while before I review them for publishing, so please check back again.