Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 12 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
12
Dung lượng
180,06 KB
Nội dung
Part Number: X08-62669 Course Number: 2389B Released: 02/2002 Delivery Guide ProgrammingwithMicrosoft ® ADO.NET Information in this document, including URL and other Internet Web site references, is subject to change without notice. Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail address, logo, person, places or events is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property. 2001-2002 Microsoft Corporation. All rights reserved. Microsoft, MS-DOS, Windows, Windows NT, Win32, Active Directory, ActiveX, BizTalk, IntelliSense, JScript, MSDN, SQL Server, Visual Basic, Visual C#, Visual C++, Visual J#, Visual Studio, and Windows Media are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other countries. The names of actual companies and products mentioned herein may be the trademarks of their respective owners. Course Number: 2389B Part Number: X08-62669 Released: 02/2002 Programmingwith Microsoft® ADO.NET iii Contents Introduction Course Materials 2 Prerequisites .3 Course Outline .4 Microsoft Certified Professional Program .6 Facilities .9 Module 1: Data-Centric Applications and ADO.NET Overview 1 Lesson: Design of Data-Centric Applications 2 Lesson: ADO.NET Architecture 9 Lesson: ADO.NET and XML 19 Multimedia: ADO.NET and XML .22 Demonstration: ADO.NET and XML 23 Review .28 Lab 1.1: Data-Centric Applications and ADO.NET 30 Module 2: Connecting to Data Sources Overview 1 Lesson: Choosing a .NET Data Provider .2 Lesson: Defining a Connection 8 Lesson: Managing a Connection 16 Lesson: Handling Connection Exceptions .25 Lesson: Connection Pooling 37 Review: Connecting to Data Sources .48 Lab 2.1: Connecting to Data Sources .50 Module 3: Performing Connected Database Operations Overview 1 Lesson: Working in a Connected Environment .2 Lesson: Building Command Objects .4 Lesson: Executing Command Objects That Return a Single Value .17 Lesson: Executing Commands That Return Rows .24 Lesson: Executing Commands That Do Not Return Rows 35 Lesson: Using Transactions .48 Review .57 Lab 3.1: Performing Connected Database Operations .59 iv Programmingwith Microsoft® ADO.NET Module 4: Building DataSets Overview . 1 Lesson: Working in a Disconnected Environment 2 Lesson: Building DataSets and DataTables 5 Lesson: Binding and Saving a DataSet . 18 Lab 4.1: Building, Binding, Opening, and Saving DataSets . 25 Lesson: Defining Data Relationships 37 Lesson: Modifying Data in a DataTable . 43 Lesson: Sorting and Filtering 54 Review 60 Lab 4.2: Manipulating DataSets 62 Module 5: Reading and Writing XML withADO.NET Overview . 1 Lesson: Creating XSD Schemas . 2 Lesson: Loading Schemas and Data into DataSets . 14 Lesson: Writing XML from a DataSet 25 Review 33 Lab 5.1: Working with XML Data in ADO.NET . 35 Course Evaluation . 43 Module 6: Building DataSets from Existing Data Sources Overview . 1 Lesson: Configuring a DataAdapter to Retrieve Information . 2 Lesson: Populating a DataSet Using a DataAdapter . 14 Lab 6.1: Retrieving Data into a Disconnected Application . 29 Lesson: Configuring a DataAdapter to Update the Underlying Data Source . 45 Lesson: Persisting Changes to a Data Source . 56 Lesson: How to Handle Conflicts . 67 Review 76 Lab 6.2: Retrieving and Updating Customers and Orders Data 78 Module 7: Building and Consuming a Web Service That Uses ADO.NET Overview . 1 Lesson: Building and Consuming a Web Service That Returns Data . 2 Review 15 Lab 7.1: Troubleshooting an ADO.NET Application . 16 Course Evaluation . 25 Programmingwith Microsoft® ADO.NET v About This Course This section provides you with a brief description of the course, audience, suggested prerequisites, and course objectives. This course teaches developers to build data-centric applications and Web services withMicrosoft ® ADO.NET, Microsoft SQL Server ™ 2000, and the Microsoft .NET Framework. This course is designed for the professional platform developer who is responsible for designing and building data-centric, distributed applications for his or her organization. It is designed for developers who have component and Web-application development skills and who have previously built solutions by using Microsoft Visual Studio ® . Typically, these individuals will have the following skills: ! Experience with a .NET language such as Microsoft Visual Basic ® .NET, Microsoft Visual C# ™ , or Microsoft Visual C++ ® ! An understanding of object oriented concepts and terminology ! Experience developing distributed applications ! Experience developing Web-based applications hosted on Internet Information Server Typically, these individuals perform the following key activities: ! Develop, design, and create interface specifications ! Create and test prototypes ! Design site security measures ! Develop application and data models ! Write supporting codeDevelop supporting relational databases Description Audience vi Programmingwith Microsoft® ADO.NET This course requires that students meet the following prerequisites: Prerequisite skill This skill can be fulfilled by taking Basic understanding of database concepts including tables, rows, columns, primary keys, foreign keys, constraints, and views Course 1609, Designing Data Services and Data Models Understanding of database query concepts and SQL statements including SELECT, INSERT, UPDATE, and DELETE Course 2071, Querying Microsoft SQL Server 2000 with Transact-SQL Development experience using the Microsoft Visual Studio .NET development environment and the Microsoft .NET Framework Course 2373, ProgrammingwithMicrosoft Visual Basic .NET or Course 2124, Introduction to C# for the Microsoft .NET Platform Programming experience with Visual Basic .NET or Visual C# Course 2373, ProgrammingwithMicrosoft Visual Basic .NET or Course 2124, Introduction to C# for the Microsoft .NET Platform Ability to build a Microsoft Windows ® or Web application Course 1303A, Mastering Microsoft Visual Basic 6 Fundamentals or Course 1017A, Mastering Web Application Development Using Microsoft Visual InterDev 6 The course assumes that students have the following skills: ! Understanding of relational database concepts: table, row, column, primary keys, foreign keys, constraints, and views ! Data query and modification experience, including experience with SELECT, INSERT, UPDATE, and DELETE commands ! Exposure to XML documents, style sheets, and schemas ! Experience with Visual Basic .NET, Visual Basic for Applications, or previous versions of Visual Basic ! Experience building user interfaces, including Web applications or Windows applications Student prerequisites Programmingwith Microsoft® ADO.NET vii After completing this course, the student will be able to: ! Describe data-centric applications, ADO.NET architecture, and ADO.NET and XML. ! Connect to SQL Server and other data sources. ! Perform connected database operations including executing SELECT commands, database definition commands, dynamic SQL commands, and commands that return data from a SQL Server database in XML. ! Build a DataSet schema, populate it with data, and modify the data programmatically. ! Build a DataSet from an existing Data Source. ! Use XML techniques while working with DataSets, including table and column mapping, creating XML Schema Definition Language (XSD) schemas, building strongly typed DataSets, and interacting with XMLDataDocuments. ! Build a Web service that uses ADO.NET to query and update a data source. ! Troubleshoot errors within an ADO.NET application. Course objectives viii Programmingwith Microsoft® ADO.NET Course Timing The following schedule is an estimate of the course timing. Your timing may vary. Day 1 Start End Module 9:00 9:30 Introduction 9:30 10:30 Module 1, Data-Centric Applications and ADO.NET 10:30 10:45 Break 10:45 11:15 Lab 1.1, Data-Centric Applications and ADO.NET 11:15 12:00 Module 2, Connecting to Data Sources 12:00 12:30 Lunch 12:30 1:15 Module 2, Connecting to Data Sources (continued) 1:15 2:45 Lab 2.1, Connecting to Data Sources 2:45 3:00 Break 3:00 5:00 Module 3, Performing Connected Database Operations Day 2 Start End Module 9:00 9:30 Day 1 review 9:30 10:30 Lab 3.1, Performing Connected Database Operations 10:30 10:45 Break 10:45 11:45 Module 4, Building DataSets 11:45 12:15 Lab 4.1, Building, Binding, Opening, and Saving DataSets 12:15 12:45 Lunch 12:45 1:15 Module 4, Building DataSets (continued) 1:15 1:45 Lab 4.2, Manipulating DataSets 1:45 3:00 Module 5, Reading and Writing XML withADO.NET 3:00 3:15 Break 3:15 3:45 Module 5, Reading and Writing XML withADO.NET (continued) 3:45 4:45 Lab 5.1, Working with XML Data in ADO.NET Programmingwith Microsoft® ADO.NET ix Day 3 Start End Module 9:00 9:30 Day 2 review 9:30 10:30 Module 6, Building DataSets from Existing Data Sources 10:30 10:45 Break 10:45 11:45 Lab 6.1, Retrieving Data into a Disconnected Application 11:45 12:30 Lunch 12:30 1:30 Module 6, Building DataSets from Existing Data Sources (continued) 1:30 2:30 Lab 6.2, Retrieving and Updating Customers and Orders Data 2:30 2:45 Break 2:45 3:15 Module 7, Building and Consuming a Web Service that Uses ADO.NET 3:15 5:15 Lab 7.1, Troubleshooting an ADO.NET Application x Programmingwith Microsoft® ADO.NET Trainer Materials Compact Disc Contents The Trainer Materials compact disc contains the following files and folders: ! Autorun.exe. When the compact disc is inserted into the compact disc drive, or when you double-click the Autorun.exe file, this file opens the compact disc and allows you to browse the Student Materials or Trainer Materials compact disc. ! Autorun.inf. When the compact disc is inserted into the compact disc drive, this file opens Autorun.exe. ! Default.htm. This file opens the Trainer Materials Web page. ! Readme.txt. This file explains how to install the software for viewing the Trainer Materials compact disc and its contents and how to open the Trainer Materials Web page. ! 2389B_ms.doc. This file is the Manual Classroom Setup Guide. It contains the steps for manually setting up the classroom computers. ! 2389B_sg.doc. This file is the Automated Classroom Setup Guide. It contains a description of classroom requirements, classroom configuration, instructions for using the automated classroom setup scripts, and the classroom Setup Checklist. ! Powerpnt. This folder contains the PowerPoint slides that are used in this course. ! Pptview. This folder contains the PowerPoint Viewer, which is used to display the PowerPoint slides. ! Setup. This folder contains the files that install the course and related software to computers in a classroom setting. ! StudentCD. This folder contains the Web page that provides students with links to resources pertaining to this course, including additional reading, review and lab answers, lab files, multimedia presentations, and course- related Web sites. ! Tools. This folder contains files and utilities used to complete the setup of the instructor computer. ! Webfiles. This folder contains the files that are required to view the course Web page. To open the Web page, open Windows Explorer, and in the root directory of the compact disc, double-click Default.htm or Autorun.exe. [...].. .Programming with Microsoft ADO.NET xi Student Materials Compact Disc Contents The Student Materials compact disc contains the following files and folders: ! Autorun.exe When the compact disc is inserted into the CD-ROM... disc, double-click Default.htm or Autorun.exe ! Wordview This folder contains the Word Viewer that is used to view any Word document (.doc) files that are included on the compact disc xii Programming with Microsoft ADO.NET Document Conventions The following conventions are used in course materials to distinguish elements of the text Convention Use " Indicates an introductory page This symbol appears... syntax indicates that you can choose to type a file name with the command Type only the information within the brackets, not the brackets themselves {} In syntax statements, enclose required items Type only the information within the braces, not the braces themselves | In syntax statements, separates an either/or choice ! Indicates a procedure with sequential steps In syntax statements, specifies... are required to view the Microsoft PowerPoint® presentation and Web-based materials ! Labs This folder contains files that are used in the hands-on labs These files may be used to prepare the student computers for the hands-on labs ! Media This folder contains files that are used in multimedia presentations for this course ! Mplayer This folder contains the setup file to install Microsoft Windows Media™... compact disc ! Autorun.inf When the compact disc is inserted into the compact disc drive, this file opens Autorun.exe ! Default.htm This file opens the Student Materials Web page It provides students with resources pertaining to this course, including additional reading, review and lab answers, lab files, multimedia presentations, and course-related Web sites ! Readme.txt This file explains how to . XML with ADO. NET 3:00 3:15 Break 3:15 3:45 Module 5, Reading and Writing XML with ADO. NET (continued) 3:45 4:45 Lab 5.1, Working with XML Data in ADO. NET. Consuming a Web Service that Uses ADO. NET 3:15 5:15 Lab 7.1, Troubleshooting an ADO. NET Application x Programming with Microsoft ADO. NET Trainer Materials Compact