Presentation is loading. Please wait.

Presentation is loading. Please wait.

ODBC, OLE DB, and ADO Introduction Dr. Ron Eaglin.

Similar presentations


Presentation on theme: "ODBC, OLE DB, and ADO Introduction Dr. Ron Eaglin."— Presentation transcript:

1 ODBC, OLE DB, and ADO Introduction Dr. Ron Eaglin

2 Data Access Standards The reasons for ODBC, OLE DB, and ADO are to provide a standardized method and API for accessing and manipulating Data from different databases. ODBC (Open Database Connectivity) – is the most basic and common standard interface for accessing databases.

3 ODBC Conformance Levels Application Programming Interface –Core –Level 1 –Level 2 SQL Grammar –Minimum –Core –Extended

4 Establishing an ODBC Datasource In Control Panel, Administrative Options, there is an icon for ODBC Datasources

5 ODBC Datasources

6 File Data Source – A physical file which can be shared among users on a single computer. System Data Source – A source of data that is local to a single computer. Can be remotely accessed through the computer. User Data Source – Available only to the user who created it.

7 System DSN

8

9

10

11

12 Microsoft OLE DB Creates an Object Oriented Programming model on top of ODB (and other drivers) to allow a programmatic access to database through a Object Oriented interface.

13 Using Microsoft OLE DB Client Application Code ODBC Data Sources MDB Files SQL Server ADO OLE DB Consumer OLE DB MSDASQL.DLL SQLOLEDB.DLL MSJTOR35.DLL OLE DB Providers Db Client Application that uses OLE DB

14 ADO and ADO.Net One level of abstraction higher that OLE DB. Basic object model that overlies the more complex OLE DB model.

15 Basic Definition Namespace – In programming a namespace encapsulates other name spaces, programming classes, and other functions that are common and uniquely named.

16 ADO.Net Namespaces The ADO.NET Object Model –Objects of System.Data –.NET data providers ADO.NET namespace hierarchy –Organizes the object model –Includes: System.Data System.Data.OleDb System.Data.Common System.Data.SqlClient System.Data.SqlTypes

17 The System.Data Namespace System.Data.OleDb.SqlClient OleDbCommand OleDbConnection OleDbDataReader OleDbDataAdapter SqlCommand SqlConnection SqlDataReader SqlDataAdapter.Common Contains classes shared by both

18 System.Data Classes System.Data DataTable - In-memory cache of a database table DataRow - Used to manipulate a row in a DataTable DataRelation - Used to relate 2 DataTables to each other DataColumn - Used to define the columns in a DataTable DataViewManager - Used to create views on DataSets DataSet - In-memory cache of data

19 Using ADO.Net Classes Connection Object –ODBCConnection –OleDBConnection –SQLConnection ConnectionString property – defines the information to allow connecting to a database.

20 Connection Class // create a connection string String conStr="Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=NWIND_RW.MDB"; // create a connection object using the connection string OleDbConnection aConn = new OleDbConnection(conStr); // open the connection aConn.Open(); // Perform database actions aConn.Close();


Download ppt "ODBC, OLE DB, and ADO Introduction Dr. Ron Eaglin."

Similar presentations


Ads by Google