0
Microsoft ®  ADO.NET Presented by Joseph J. Sarna Jr. JJS Systems, LLC
Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul...
ADO versus ADO.NET Uses DATASET object (contains one or more DATATABLE objects) Uses RECORDSET object (contains one table)...
ADO versus ADO.NET (continued) XML flows through the firewall via HTTP Firewalls block system-level COM marshalling Firewa...
Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul...
ADO.NET Architecture Diagram
ADO.NET Namespaces Native data types in Microsoft® SQL Server System.Data.SqlTypes Types that are optimized to connect to ...
Importing the ADO.NET Namespaces <ul><li>Needed to build a data access application </li></ul><ul><li>For OLE DB: </li></ul...
Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul...
Connection object <ul><li>Connects to databases.  </li></ul><ul><li>Two provider-specific classes  </li></ul><ul><ul><li>S...
Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul...
Command Object <ul><li>Information submitted to a database as a query via a Connection object </li></ul><ul><li>Two provid...
Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul...
DataReader Object <ul><li>Provides methods and properties that deliver a forward-only stream of data rows from a data sour...
Create DataReader Example
Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul...
DataAdapter Object <ul><li>Provides a set of methods and properties to retrieve and save data between a  DataSet  and its ...
Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul...
DataSet Object <ul><li>Replaces the ADO Recordset </li></ul><ul><li>Represents a cache of data that contains tables, colum...
Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul...
DataView Object <ul><li>Provides methods and properties that enable UI objects such as a DataGrid to bind to a DataSet  </...
Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul...
Create Data Access Windows Form
Create Multiple Table DataSet Example
Summary <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><u...
New Hampshire Access/Visual Basic User Group <ul><li>Meets 4 th  Wednesday of each month </li></ul><ul><li>Meetings held a...
Upcoming SlideShare
Loading in...5
×

Ado.net

2,600

Published on

dfgdg

Published in: Education
1 Comment
2 Likes
Statistics
Notes
  • svp j'ai besoin d'un code qui me permis de sélectionne de puis un combobox et affiché en datagruid . veillez m'envoyé la réponse sur amine.khadli@gmail.com et mérci
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
2,600
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
214
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "Ado.net"

  1. 1. Microsoft ® ADO.NET Presented by Joseph J. Sarna Jr. JJS Systems, LLC
  2. 2. Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul><li>Command Object </li></ul><ul><li>DataReader Object </li></ul><ul><li>DataAdapter Object </li></ul><ul><li>DataSet Object </li></ul><ul><li>DataView Object </li></ul><ul><li>Use ADO.NET to access data in an application </li></ul>
  3. 3. ADO versus ADO.NET Uses DATASET object (contains one or more DATATABLE objects) Uses RECORDSET object (contains one table) Form of data in memory Transfers DATASET object via XML. No data conversions required Uses COM to marshal RECORDSET Disconnected access across multi-tiers Uses DATASETCOMMAND object with OLEDB Uses CONNECTION object and RECORDSET object with OLEDB Disconnected access Disconnected collection of data from data server Client/server coupled Primary Aim ADO.NET ADO Feature
  4. 4. ADO versus ADO.NET (continued) XML flows through the firewall via HTTP Firewalls block system-level COM marshalling Firewalls Managed code library – Uses Common Language Runtime, therefore, language agnostic Coupled to the language used, various implementation Code XML is the native transfer medium for the objects XML aware XML capabilities ADO.NET ADO Feature
  5. 5. Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul><li>Command Object </li></ul><ul><li>DataReader Object </li></ul><ul><li>DataAdapter Object </li></ul><ul><li>DataSet Object </li></ul><ul><li>DataView Object </li></ul><ul><li>Use ADO.NET to access data in an application </li></ul>
  6. 6. ADO.NET Architecture Diagram
  7. 7. ADO.NET Namespaces Native data types in Microsoft® SQL Server System.Data.SqlTypes Types that are optimized to connect to Microsoft® SQL Server System.Data.SqlClient Types that allow connection to OLE DB compliant data sources System.Data.OleDb Types shared between managed providers System.Data.Common Core namespace, defines types that represent data System.data
  8. 8. Importing the ADO.NET Namespaces <ul><li>Needed to build a data access application </li></ul><ul><li>For OLE DB: </li></ul><ul><ul><ul><li>Imports System.Data </li></ul></ul></ul><ul><ul><ul><li>Imports System.Data.OleDB </li></ul></ul></ul><ul><li>For SQL Server: </li></ul><ul><ul><ul><li>Imports System.Data </li></ul></ul></ul><ul><ul><ul><li>Imports System.Data.SQLClient </li></ul></ul></ul>
  9. 9. Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul><li>Command Object </li></ul><ul><li>DataReader Object </li></ul><ul><li>DataAdapter Object </li></ul><ul><li>DataSet Object </li></ul><ul><li>DataView Object </li></ul><ul><li>Use ADO.NET to access data in an application </li></ul>
  10. 10. Connection object <ul><li>Connects to databases. </li></ul><ul><li>Two provider-specific classes </li></ul><ul><ul><li>SqlConnection </li></ul></ul><ul><ul><li>OleDbConnection . </li></ul></ul><ul><li>Connections can be opened in two ways: </li></ul><ul><ul><li>Explicitly by calling the Open method on the connection </li></ul></ul><ul><ul><li>Implicitly when using a DataAdapter . </li></ul></ul><ul><li>Connections handle transactions </li></ul>
  11. 11. Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul><li>Command Object </li></ul><ul><li>DataReader Object </li></ul><ul><li>DataAdapter Object </li></ul><ul><li>DataSet Object </li></ul><ul><li>DataView Object </li></ul><ul><li>Use ADO.NET to access data in an application </li></ul>
  12. 12. Command Object <ul><li>Information submitted to a database as a query via a Connection object </li></ul><ul><li>Two provider-specific classes </li></ul><ul><ul><li>SqlCommand </li></ul></ul><ul><ul><li>OleDbCommand </li></ul></ul><ul><li>Input and output parameters are supported, along with return values as part of the command syntax </li></ul><ul><li>Results are returned in the form of streams. Accessed by: </li></ul><ul><ul><li>DataReader object </li></ul></ul><ul><ul><li>DataSet object via a DataAdapter </li></ul></ul>
  13. 13. Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul><li>Command Object </li></ul><ul><li>DataReader Object </li></ul><ul><li>DataAdapter Object </li></ul><ul><li>DataSet Object </li></ul><ul><li>DataView Object </li></ul><ul><li>Use ADO.NET to access data in an application </li></ul>
  14. 14. DataReader Object <ul><li>Provides methods and properties that deliver a forward-only stream of data rows from a data source </li></ul><ul><li>When a DataReader is used, parts of the ADO.NET model are cut out, providing faster and more efficient data access </li></ul>
  15. 15. Create DataReader Example
  16. 16. Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul><li>Command Object </li></ul><ul><li>DataReader Object </li></ul><ul><li>DataAdapter Object </li></ul><ul><li>DataSet Object </li></ul><ul><li>DataView Object </li></ul><ul><li>Use ADO.NET to access data in an application </li></ul>
  17. 17. DataAdapter Object <ul><li>Provides a set of methods and properties to retrieve and save data between a DataSet and its source data store </li></ul><ul><li>Allows the use of stored procedures </li></ul><ul><li>Connects to the database to fill the DataSet and also update the database </li></ul>
  18. 18. Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul><li>Command Object </li></ul><ul><li>DataReader Object </li></ul><ul><li>DataAdapter Object </li></ul><ul><li>DataSet Object </li></ul><ul><li>DataView Object </li></ul><ul><li>Use ADO.NET to access data in an application </li></ul>
  19. 19. DataSet Object <ul><li>Replaces the ADO Recordset </li></ul><ul><li>Represents a cache of data that contains tables, columns, relationships, and constraints, just like a database </li></ul><ul><li>Regardless of where the source data comes from, data can all be placed into DataSet objects </li></ul><ul><li>Tracks changes that are made to the data it holds before updating the source data </li></ul><ul><li>DataSet are also fully XML-featured </li></ul><ul><li>Works with all current models of data storage: flat, relational, and hierarchical </li></ul>
  20. 20. Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul><li>Command Object </li></ul><ul><li>DataReader Object </li></ul><ul><li>DataAdapter Object </li></ul><ul><li>DataSet Object </li></ul><ul><li>DataView Object </li></ul><ul><li>Use ADO.NET to access data in an application </li></ul>
  21. 21. DataView Object <ul><li>Provides methods and properties that enable UI objects such as a DataGrid to bind to a DataSet </li></ul><ul><li>A view of the data contained in the DataSet </li></ul><ul><li>Only used in conjunction with a DataSet </li></ul>
  22. 22. Agenda <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul><li>Command Object </li></ul><ul><li>DataReader Object </li></ul><ul><li>DataAdapter Object </li></ul><ul><li>DataSet Object </li></ul><ul><li>DataView Object </li></ul><ul><li>Use ADO.NET to access data in an application </li></ul>
  23. 23. Create Data Access Windows Form
  24. 24. Create Multiple Table DataSet Example
  25. 25. Summary <ul><li>ADO versus ADO.NET </li></ul><ul><li>ADO.NET Architecture </li></ul><ul><li>Connection Object </li></ul><ul><li>Command Object </li></ul><ul><li>DataReader Object </li></ul><ul><li>DataAdapter Object </li></ul><ul><li>DataSet Object </li></ul><ul><li>DataView Object </li></ul><ul><li>Use ADO.NET to access data in an application </li></ul>
  26. 26. New Hampshire Access/Visual Basic User Group <ul><li>Meets 4 th Wednesday of each month </li></ul><ul><li>Meetings held at Southern New Hampshire University </li></ul><ul><li>Link to Information - http://www. jjssystems .net </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×