Disconnected Data Access in ASP.Net C#

The ADO.NET Framework supports two models of data access. The SqlConnection, SqlCommand, and SqlDataReader objects to connect to a database and retrieve data. When you read data from a database by using a SqlDataReader object, an open connection must be maintained between your application and the database.

This section discusses four new ADO.NET objects:
  • DataAdapter : Enables you to transfer data from the physical database to the inmemory database and back again.
  • DataTable : Represents an in-memory database table.
  • DataView : Represents an in-memory database view.
  • DataSet : Represents an in-memory database.
The ADO.NET objects the DataAdapter uses a DataReader to retrieve data from a database.
The advantage of using the objects discussed in this section is that they provide you with more functionality. For example, you can filter and sort the rows represented by a DataView. Furthermore, you can use the DataTable object to track changes made to records and accept or reject the changes.
The big disadvantage of using the objects discussed in this section is that they tend to be slower and more resource intensive. Retrieving 500 records with a DataReader is much faster than retrieving 500 records with a DataAdapter.
Tags: , , ,
Hot on Web:


About author