ADO.Net Data Access Model for ASP.Net-Part 2

by top54u.com 16 Apr, 2008

In the first part of ADO.Net data access model for ASP.Net we discussed about Connection, Command and DataReader that enables you to connect to the data source and retrieve data. For using DataReader the open connection state has to be maintained to for retrieving the data and represent in the application.

 

Disconnected Data Access Model

In this part we will learn about second type of model i.e. Disconnected Data Access model of ADO.Net.  This data access approach does not need to keep an open connection to database. This Data Access Model includes the following classes:

  1. DataAdapter:
    It executes to fill the DataSet in-memory by retrieved data from the data source.


  2. DataTable:
    It represents the in-memory Data Table retrieved using DataAdapter that fills the DataSet containing the Relational DataTable hierarchy. 


  3. DataView:
    It represents the in-memory view of database table that can be modified using filters to represent the DataTable with different views.


  4. DataSet:
    It represents the in-memory database retrieved by using DataAdapter.

 

At the backend DataAdapter uses DataReader to retrieve the data from the database. It automatically opens and closes the database connection. If the database connection is already open before its execution then DataAdapter leaves it open after being executed.

 

Further these classed provide the functionality to generate the views of DataTable created by retrieving the data from database table. You can filter DataTable into DataView to represent the data according to the requirements.

 

Disadvantage of using these objects is slow performance due to large usage of memory for storing number records. For comparison between DataReader and DataAdapter, DataReader works much faster than DataAdapter for retrieving more than 1000 records at a time.

 

Above discussed Disconnected Data Access component DataAdapter has names according to their providers.

For example:

SqlDataAdapter, OleDbDataAdapter, ODBCDataAdpater

 

Other Objects DataView, DataTable and DataSet are common for all data providers and comes under same namespace i.e. System.Data

Spotlight.....

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , , , ,

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

10/11/2008 3:29:21 AM




related videos.....
recent posts.....
top54u ezines.....