7
Advanced ADO.NET Peter Ty Peter Ty MCSD, MCDBA, MCP+SB, MCSE MCSD, MCDBA, MCP+SB, MCSE Developer Evangelist Developer Evangelist Microsoft Hong Kong Ltd. Microsoft Hong Kong Ltd. [email protected] [email protected]

6 Slidesdfsdfsdhbkdflgjdflgjlkeroueriotr,Dnghkfxhckghdsflhl;Jkjlahfdhklgfdgdf

Embed Size (px)

Citation preview

Page 1: 6 Slidesdfsdfsdhbkdflgjdflgjlkeroueriotr,Dnghkfxhckghdsflhl;Jkjlahfdhklgfdgdf

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

Page 2: 6 Slidesdfsdfsdhbkdflgjdflgjlkeroueriotr,Dnghkfxhckghdsflhl;Jkjlahfdhklgfdgdf

Agenda Introduction to ADO.NET Programming with ADO.NET XML Support Advanced Features Converting ADO to ADO.NET When To Use What?

Page 3: 6 Slidesdfsdfsdhbkdflgjdflgjlkeroueriotr,Dnghkfxhckghdsflhl;Jkjlahfdhklgfdgdf

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

Page 4: 6 Slidesdfsdfsdhbkdflgjdflgjlkeroueriotr,Dnghkfxhckghdsflhl;Jkjlahfdhklgfdgdf

Introduction to ADO.NETWhy ADO.NET?

To Accommodate Web Application Model Loosely coupled Maintaining state between requests Uses HTTP

Page 5: 6 Slidesdfsdfsdhbkdflgjdflgjlkeroueriotr,Dnghkfxhckghdsflhl;Jkjlahfdhklgfdgdf

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

Page 6: 6 Slidesdfsdfsdhbkdflgjdflgjlkeroueriotr,Dnghkfxhckghdsflhl;Jkjlahfdhklgfdgdf

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

Page 7: 6 Slidesdfsdfsdhbkdflgjdflgjlkeroueriotr,Dnghkfxhckghdsflhl;Jkjlahfdhklgfdgdf

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