السبت، 20 ديسمبر 2008

¯ What is ADO.NET?

¯   Overview

ü     A Database is an organized collection of information that is divided into tables. Each table is further divided into rows and columns; these columns store the actual information.

ü      You access a database using Structured Query Language (SQL), which is a standard language supported by most database software including SQL Server, Access, and Oracle.

ü       

¯    What is ADO.NET?

1.       ADO.NET is the new database technology of the .NET (Dot Net) platform, and it builds on Microsoft ActiveX® Data Objects (ADO).

2.     ADO.NET is an integral part of the .NET Compact Framework, providing access to relational data, XML documents, and application data.

3.     ADO.NET defines DataSet and DataTable objects which are optimized for moving disconnected sets of data across intranets and Internets, including through firewalls. It also includes the traditional Connection and Command objects, as well as an object called a DataReader that resembles a forward-only, read-only ADO recordset. If you create a new application, your application requires some form of data access most of the time.

 

You can use ADO.NET to access data by using the new .NET Framework data providers which are:

 

Data Provider for SQL Server (System.Data.SqlClient).

Data Provider for OLEDB (System.Data.OleDb).

Data Provider for ODBC (System.Data.Odbc).

Data Provider for Oracle (System.Data.OracleClient).

 

ü     The ADO.NET classes are found in System.Data.dll (Root Class) and are integrated with the XML classes in System.Xml.dll.

DataSet object represents a disconnected cache of data which is made up of DataTables and DataRelations that represent the result of the command

ý      ADO.NET allows data manipulation to be done using either a connected or a disconnected model. The following table describes how each method works

Connected Model

Disconnected Model

  1. The application establishes a connection with the data source.
  2. The application reads data and executes commands to manipulate data on the data source.
  3. The connection remains open until closed by either the client or the server.
  1. The application establishes a connection with the data source.
  2. Requested data is transferred to the application and stored in a memory cache on the client.
  3. The connection is closed.
  4. The application modifies or otherwise works with the data.
  5. To synchronize changes back to the data source, the connection is reestablished, the data transferred, and the connection is immediately closed.

The disconnected model helps conserve server resources and helps the scalability of the application.

The following table lists the components used in each data access model.

Component

Description

Applicable Data Access Model

Data source

The data source is the database on the server, but can also be many other kinds of data repositories such as an XML file.

Connected
Disconnected

Connection

The Connection object includes information necessary to establish a connection to the data source.
Connections are data source specific. For example, use a SqlConnection to make a connection to a SQL database.

Connected
Disconnected

Command

A Command object executes read and write operations on the data source.
Command objects are data source specific and are associated with a Connection object.

Connected
Disconnected

DataReader

The DataReader represents a set of read-only, forward-only rows from a database. Use a DataReader when you need fast access and need only to read through the data from beginning to end one time.
The DataReader is data source specific.

Connected

DataAdapter

A DataAdapter manages the process of communicating with the data source.
Commands are associated with a DataAdapter. When a command is executed, the DataAdapter automatically opens and closes the connection with the data source.
The DataAdapter is data source specific.

Disconnected

DataSet

The DataSet is the client-side, in-memory copy of the data. DataAdapters fill the DataSet tables, rows, and columns using data from the data source.
DataSets are source neutral, meaning they can contain data from different kinds of data sources.
DataSets also have multiple tables. A single DataSet can therefore be used to hold data from multiple different sources. You can also use the DataSet to establish relationships between tables.

Disconnected

1 التعليقات:

Unknown يقول...

الف مبروك البلوج يا أحمد باشا

وفعلا بلوج جامد ومواضيعه ميه ميه

ربنا معاك ان شاء الله ياجميل