Presented by: Tim O’Brien Senior Systems Engineer Fujitsu Software Corporation
Advanced ADO.NET Programming and Introduction to XML Fujitsu Software Corporation Customer Training Series
Fujitsu Computer Systems
Advanced ADO.NET Programming / Intro to XML ■
Discussion of ADO.NET in more detail
■
Create a more complex ADO.NET COBOL application
■
Introduction to XML
■
XML in the .NET environment
■
Create a COBOL application using XML classes
PAGE 2
Fujitsu Computer Systems
ADO.NET: Connection Object ■
Links the data requestor with the data provider
■
Used by other objects to perform operations on the database
■
Information required to establish a connection is provided in the ConnectionString
PAGE 3
Fujitsu Computer Systems
ADO.NET: Connection Object (Cont…) ■
The Open method is used to create the connection using the ConnectionString information
■
Data operations may then be performed
■
The Close method is invoked to close the connection
PAGE 4
Fujitsu Computer Systems
ADO.NET: the DataReader Object ■
Provides read only, forward only, fast sequential access
■
Lightweight
■
Ideal for web applications that do not update data
PAGE 5
Fujitsu Computer Systems
ADO.NET: the DataSet Object ■
Provides disconnected access
■
Data is cached in memory
■
More suitable for random access and update operations
■
Supports serialization of XML – may be loaded from XML or saved to XML (data or schema)
PAGE 6
Fujitsu Computer Systems
ADO.NET: the DataSet Object (Cont…) ■
Typically contains DataTable objects, which contain DataRows and DataColumns objects
■
May also contain Constraints and DataRelations objects
PAGE 7
Fujitsu Computer Systems
Demo
PAGE 8
Fujitsu Computer Systems
Introduction to XML ■
Enables the creation of custom markup languages based on elements and attributes
■
Cross platform standard
■
Highly useful for transporting data, as it may contain the data and the data’s schema – making it self defining data
PAGE 9
Fujitsu Computer Systems
Introduction to XML (Cont…) ■
The XmlDocument object contains document definitions
■
The XMLDataDocument object may contain relational data in XML format
■
Becoming the standard language of the internet in describing data and documents
PAGE 10
Fujitsu Computer Systems
Introduction to XML (Cont…) ■
Supports use of style sheets that assist in the definition of large complex documents
■
XML may be displayed within an HTML page and HTML may be used within an XML document
■
XML parsers parse XML and put it into an organized more readable format
PAGE 11
Fujitsu Computer Systems
Introduction to XML (Cont…) ■
Extensible Style Sheets (XSL) contain style sheet information
■
XSLT (XSL transformations) translate XML definitions into other XML definition formats or into non-XML formats such as HTTP, for example
PAGE 12
Fujitsu Computer Systems
XML Code Sample
<UserGroup last="3"> <User name="TA1" passwd="ta"> <User name="TA2" passwd="tb"> <User name="TA3" passwd="tc">
PAGE 13
Fujitsu Computer Systems
XML in the .NET environment ■
Fully XML enabled
■
Provides XML classes for reading writing and transforming XML
■
The XmlDocument object provides methods and properties for dealing with XML documents
PAGE 14
Fujitsu Computer Systems
XML in the .NET environment (Cont…) ■
The XMLDataDocument object extends XmlDocument and may contain relational data in XML format. May expose any loaded document as an ADO DataSet object
■
Visual Studio .NET includes an XML editor
PAGE 15
Fujitsu Computer Systems
Demo
PAGE 16
Fujitsu Computer Systems
Questions
PAGE 17
Fujitsu Computer Systems