1 / 5

CSC 298

CSC 298. ADO .NET. ADO .NET . A data access technology that maps very well to the world of the web (disconnected architecture) data is retrieved from the database and cached on the local machine (similar from a web session). Two providers.

bwarden
Download Presentation

CSC 298

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. CSC 298 ADO .NET

  2. ADO .NET • A data access technology that maps very well to the world of the web (disconnected architecture) • data is retrieved from the database and cached on the local machine (similar from a web session)

  3. Two providers • SQL server .NET provider to interface with Microsoft SQL servers • all of the code is managed by the CLR • namespace System.Data.SqlClient • OLE DB .NET for other data base servers • goes through unmanaged code (not as efficient) • namespace System.Data.OleDb

  4. Connecting to a database • Use a Connection object, e.g. OleDbConnection c; c = new OleDbConnection( "provider = Microsoft.Jet.OleDb.4.0; " + @"data source = C:\Northwind.mdb"); • Don't forget to open the connection • c.open();

  5. Communicating with the DB queries DB DataAdapter DataSet updates • Use a DataSet and a DataAdapter (e.g. OleDbDataAdapter) • Displaying the data: use a DataGrid

More Related