1 / 20

ODBC, OLE DB, and ADO Introduction

ODBC, OLE DB, and ADO Introduction. Dr. Ron Eaglin. 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.

lixue
Download Presentation

ODBC, OLE DB, and ADO Introduction

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. ODBC, OLE DB, and ADOIntroduction 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. ODBC Datasources • 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. System DSN

  9. System DSN

  10. System DSN

  11. System DSN

  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 OLE DBProviders OLE DBConsumer ODBC Data Sources OLEDB Client Application Code MSDASQL.DLL ADO SQL Server Db Client Application that uses OLE DB SQLOLEDB.DLL MDB Files MSJTOR35.DLL

  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 .CommonContains classes shared by both System.Data .OleDb .SqlClient SqlCommandSqlConnectionSqlDataReaderSqlDataAdapter OleDbCommandOleDbConnectionOleDbDataReaderOleDbDataAdapter

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

  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();

More Related