Upload
guest5eed7
View
252
Download
0
Embed Size (px)
Citation preview
Advanced ADO.NET
Peter TyPeter TyMCSD, MCDBA, MCP+SB, MCSEMCSD, MCDBA, MCP+SB, MCSE
Developer EvangelistDeveloper EvangelistMicrosoft Hong Kong Ltd.Microsoft Hong Kong [email protected]@microsoft.com
Agenda Introduction to ADO.NET Programming with ADO.NET XML Support Advanced Features Converting ADO to ADO.NET When To Use What?
Introduction to ADO.NETWhat is ADO.NET? Natural Evolution of ADO Interoperability
Based on standards like XML, XSD
Scalability Targets distributed, disconnected web scenarios
Model Distributed architecture replacing client/server Integration of data from multiple heterogeneous
sources
Introduction to ADO.NETWhy ADO.NET?
To Accommodate Web Application Model Loosely coupled Maintaining state between requests Uses HTTP
Introduction to ADO.NETComparison Between ADO and ADO.NET
Feature ADO ADO.NET
Memory-resident Data Representation
RecordSet can contain one table
DataSet can contain one or more tables represented by DataTable Object
Relationship Between Multiple Tables
Require the JOIN query Supports the DataRelation object
Data Visitation Scans RecordSet rows sequentially
Uses a navigation paradigm for non-sequential access
Disconnected Access
Provided by RecordSet but typically supports connected access
Communicates with standardized calls to the DataAdapter
Introduction to ADO.NETComparison Between ADO and ADO.NET
Feature ADO ADO.NET
Programmability Uses Connection object to transmit commands
Uses strongly typed programming characteristics of XML
Sharing Disconnected Data Between Tiers or Components
Uses COM marshalling to transmit disconnected record set
Transmits a DataSet with an XML file
Transmitting Data Through Firewalls
Problematic because firewall are typically configured to prevent system-level requests
Supported, DataSet object use XML, which can pass through firewalls
Scalability Database locks and active database connections for long durations
Disconnected access to database data without retaining database locks
Introduction to ADO.NETManaged Data Overview
Managed ProviderManaged Provider
DataReaderDataReader
CommandCommandConnectionConnection
SyncSync
Controls,Controls,Designers,Designers,
Code-gen, etcCode-gen, etc
DataSetDataSet
XmlReaderXmlReader
XmlText-XmlText-ReaderReader
XmlNode-XmlNode-ReaderReader
XSL/T, X-Path,XSL/T, X-Path,Validation, etcValidation, etc
XmlData-XmlData-DocumentDocument
DataAdapterDataAdapter