Presentation is loading. Please wait.

Presentation is loading. Please wait.

C# 1 CSC 298 ADO.NET. C# 2 ADO.NET  A data access technology that maps very well to the world of the web (disconnected architecture)  data is retrieved.

Similar presentations


Presentation on theme: "C# 1 CSC 298 ADO.NET. C# 2 ADO.NET  A data access technology that maps very well to the world of the web (disconnected architecture)  data is retrieved."— Presentation transcript:

1 C# 1 CSC 298 ADO.NET

2 C# 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 C# 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 C# 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 C# 5 Communicating with the DB  Use a DataSet and a DataAdapter (e.g. OleDbDataAdapter) DB queries updates DataAdapter DataSet  Displaying the data: use a DataGrid


Download ppt "C# 1 CSC 298 ADO.NET. C# 2 ADO.NET  A data access technology that maps very well to the world of the web (disconnected architecture)  data is retrieved."

Similar presentations


Ads by Google