moving from microsoft ® ado 2.x to ado.net jackie goldstein renaissance computer systems ltd. msdn...
Post on 02-Jan-2016
213 Views
Preview:
TRANSCRIPT
Moving from MicrosoftMoving from Microsoft®® ADO 2.X To ADO 2.X To ADO.NETADO.NET
Jackie GoldsteinJackie Goldstein
Renaissance Computer Systems Ltd.
MSDN Regional Director, Israel
Jackie@Renaissance.co.il
Prerequisites for presentation:
I assume you know: 1) Visual Basic.NET
2) ADO 2.X
Level: Intermediate
##
Jackie Goldstein…Jackie Goldstein… General Manager of Renaissance Computer Systems
– Consulting, Training, & Development, with Microsoft Tools & Technologies
Author of “Database Access with Visual Basic.Net”
(ISBN 0-67232-3435, Addison-Wesley) MSDN Regional Director for Israel Founder and monthly host of
IVBUG (Israel Visual Basic User Group) Speaker at local & international developer
conferences:– Microsoft Developer Days, TechEd,
– VSLive!, VBITS, VB DevCon, SQL2TheMax
Selected as SME (Subject Matter Expert) to help develop/review content for DevDays with Microsoft team in Redmond
Session TopicsSession Topics
ADO.NET Architecture ADO.NET Object Model ADO.NET and XML Summary and Questions
Session TopicsSession Topics
ADO.NET Architecture ADO.NET Object Model ADO.NET and XML Summary and Questions
ADO.NETADO.NET
ADO Look and Feel… Direct OLE DB connectivity… Integrated with .NET Framework… Integrated with XML… "Designed for the Enterprise"…
The .NET FrameworkThe .NET FrameworkApplications Are Built Using the FrameworkApplications Are Built Using the Framework
Common Language Runtime
Memory Mgmt Type System Lifetime
System Base Classes
IO Threading Security ServiceProcess
Data Oledb SQLClient XML
System.Web
Web Services Web Forms
ASP Application Services
System.Windows.Forms
Controls Drawing
Windows Application Services
ADO.NET Object ModelADO.NET Object Model
Classic ADO styling…–Connection–Command, Parameter
…but a lot more functionality & flexibility–DataReader
Forward-only, Read-only "RecordSet"
–DataTable and DataSet
Disconnected, In-Memory Cache–DataAdapter
Connects a DataSet with a data source
.NET Data Provider.NET Data Provider
DataReaderDataReader
CommandCommandConnectionConnection
SyncSync
Data In The .NET PlatformData In The .NET Platform
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
Data-Data-AdapterAdapter
Points to Note in ADO.NET vs. ADOPoints to Note in ADO.NET vs. ADO
Separation between connected data access model and disconnected programming model
No CursorType, CursorLocation, or LockType ADO Recordset functionality is split into
smaller, specific objects, e.g. DataReader, DataTable, Command
ADO.NET allows manipulation of XML data, not just XML as I/O format
Session TopicsSession Topics
ADO.NET Architecture ADO.NET Object Model ADO.NET and XML Summary and Questions
.NET Data Providers.NET Data Providers
Manage interaction to a data source Microsoft Implementations
–OLEDB .NET Data Provider
–SQLServer .NET Data Provider
–ODBC .NET Data Provider
–Oracle .NET Data Provider
–Exchange .NET Data Provider Main Objects:
–Connection, Command, Parameter
–DataReader, DataAdapter
Data Data StoreStore
DataDataProviderProvider
Demo – Demo – Using .NET Data ProvidersUsing .NET Data Providers
Connection Object Command Object DataReader Object
DataSet Object DataSet Object
DataSetDataSet
DataTableDataTable
DataTableDataTable
DataRowDataRow
DataColumnDataColumn
RelationsRelations
ConstraintsConstraintsXML SchemaXML Schema
DataAdapter ObjectDataAdapter Object
DataAdapterDataAdapter
SelectCommandSelectCommand
InsertCommandInsertCommand
UpdateCommandUpdateCommand
DeleteCommandDeleteCommand
TableMappingsTableMappings
DatabaseDatabase
DataSetDataSet
Demo – Demo – Using the DataAdapterUsing the DataAdapter
Simple Fill Database Updates Using the DataAdapter Configuration
Wizard
Strongly Typed DataSetStrongly Typed DataSet
Deal with DataSets, Tables, and Rows as Objects–Columns and Relations as properties
Class Generated At Design Time– Inherits from DataSet
–Schema coded into the class Benefits
–Statement completion
–Compile time type checking
–Concise, readable code
Session TopicsSession Topics
ADO.NET Architecture ADO.NET Object Model ADO.NET and XML Summary and Questions
.NET Data Provider.NET Data Provider
DataReaderDataReader
CommandCommandConnectionConnection
SyncSync
Unified ArchitectureUnified Architecture
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
Data-Data-AdapterAdapter
ADO.NET And XML (1)ADO.NET And XML (1)
The DataSet– Loads/saves XML data into/out of DataSet
– Schema can be loaded/saved as XSD
– Schema can be inferred from XML Data
ADO.NET And XML (2) ADO.NET And XML (2) Data is XML is DataData is XML is Data
XmlDataDocument unifies XML and Data– Simultaneously exposes data relationally or as XML
– Exposes a relational view over structured XML
Plugs into entire stack of XML services– Subclass of XmlDocument – it’s a DOM
– Retains fidelity of underlying document
Plugs into entire stack of Data services– Can obtain a DataSet view of an XmlDataDoc
– Relational and XML views stay in sync
Scenarios EnabledScenarios Enabled
Simultaneously expose data relationally or as XML–Good for semi-structured data
–Multiple tools on same data Map interesting subset relationally using
schema–Use natural object model for each subset
Both DOM and DataSet can “grow up”
Demo – Demo – Accessing XML DataAccessing XML Data
XML Navigation and Selection XML Format in ADO.NET vs. ADO
2.X Synchronization of Relational and
XML Views of data
Session TopicsSession Topics
ADO.NET Architecture ADO.NET Object Model ADO.NET and XML Summary and Questions
Comparison Between ADO and Comparison Between ADO and ADO.NET (1)ADO.NET (1)
FeatureADOADO.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 querySupports the DataRelation object
Data VisitationScans RecordSet rows sequentially
Uses a navigation paradigm for non-sequential access
Disconnected AccessProvided by RecordSet but typically supports connected access
Communicates with standardized calls to the DataAdapter
Comparison Between ADO and Comparison Between ADO and ADO.NET (2)ADO.NET (2)
FeatureADOADO.NET
ProgrammabilityUses 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
ScalabilityDatabase locks and active database connections for long durations
Disconnected access to database data without retaining database locks
Session SummarySession Summary
A natural evolution of ADO Designed with extensive XML support Closely integrated with the .NET
Framework Provides fast and efficient mechanisms for
connected data access and disconnected data manipulation
Try it – You’ll Like it !!!
Questions?Questions?
Moving from MicrosoftMoving from Microsoft®® ADO 2.X To ADO 2.X To ADO.NETADO.NET
Jackie GoldsteinJackie Goldstein
Renaissance Computer Systems Ltd.MSDN Regional Director, IsraelJackie@Renaissance.co.il
Prerequisites for presentation: I assume you know: 1) Visual Basic.NET2) ADO 2.X
Level: Intermediate
##
top related