1 / 10

ADO.NET

ADO.NET. Evolution of ADO.NET DAO RDO ADO Connected Connection Problems with connected connection Why ADO.NET? Disconnected Connection. ADO.NET Data Architecture. Two components:  DataSet and Data Provider. DataSet. disconnected, in-memory representation of data

Download Presentation

ADO.NET

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ADO.NET • Evolution of ADO.NET • DAO • RDO • ADO • Connected Connection • Problems with connected connection • Why ADO.NET? • Disconnected Connection

  2. ADO.NET Data Architecture

  3. Two components:  • DataSet and Data Provider

  4. DataSet • disconnected, in-memory representation of data • local copy of the relevant portions of the DB • persisted in memory independent of DB • Supports SQL Server, Oracle, MS-Access, etc..

  5. Data Provider • providing and maintaining the connection to DB • set of related components • two DataProviders: • SQL Data Provider • OleDb DataProvider • Each DataProvider consists of the following component classes:

  6. The Connection object which provides a connection to the database • The Command object which is used to execute a command • The DataReader object which provides a forward-only, read only, connected recordset • The DataAdapter object which populates a disconnected DataSet with data and performs update

  7. The Connection Object • SqlConnection • OleDbConnection

  8. The Command Object • SqlCommand • OleDbCommand • used to execute: • Commands, • Stored Procedures, • SQL Command, • or return complete tables directly • provide three methods: • ExecuteNonQuery: INSERT, UPDATE or DELETE • ExecuteScalar: Returns a single value • ExecuteReader: Returns a result set by way of a DataReader object

  9. The DataReader Object • provides a forward-only, read-only, connected stream recordset • cannot be directly instantiated • returned as the result of the Command object's ExecuteReader method • SqlCommand.ExecuteReader method returns a SqlDataReader object, • OleDbCommand.ExecuteReader method returns an OleDbDataReader object • only one row is in memory at a time- Lowest overhead.

  10. The DataAdapter Object • the core of ADO .NET's disconnected data access • Middleman between the DB and a DataSet • fill a DataTable or DataSet with data from the database with it's Fill method • DataAdapter can commit the changes to the database by the Update method • provides four properties: • SelectCommand • InsertCommand • DeleteCommand • UpdateCommand

More Related