Objects for Disconnected Data

As has already been discussed, ADO.NET leans heavily toward a disconnected model. This is because of scalability and performance, as discussed earlier. To this point, however, your data access has been in a strictly connected mode, in which you connect to the database, process the records one at a time, and disconnect. The disconnected model, of course, has you retrieving the records, but you cache them in memory, and you can (and should) close the connection before you begin working with the records. You should close the connection because doing so means that the entire time you're scrolling through the records, formatting them for output, and allowing people to sort or filter the data, you are not consuming expensive ...

Get A Programmer's Introduction to Visual Basic® .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.