Docstoc

Prog MS VB.NET- Programming with MS VB.NET

Document Sample
Prog MS VB.NET- Programming with MS VB.NET Powered By Docstoc
					Programming with Microsoft                                                                         ®


Visual Basic .NET                              ®


(Prerelease)

Delivery Guide
Course Number: 2373A




This course is based on the prerelease version (Beta 2) of Microsoft® Visual Studio® .NET
Enterprise Edition. Content in the final release of the course may be different from the content
included in this prerelease version. All labs in the course are to be completed with the Beta 2
version of Visual Studio .NET Enterprise Edition.



Part Number: X08-45636
Released: 08/2001
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, place or event 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 Microsoft Corporation. All rights reserved.

Microsoft, MS-DOS, Windows, Windows NT, ActiveX, BizTalk, FrontPage, IntelliSense, JScript,
Microsoft Press, Outlook, PowerPoint, Visio, Visual Basic, Visual C++, Visual C#, Visual
InterDev, Visual Studio, and Windows Media are either registered trademarks or trademarks of
Microsoft Corporation in the United States and/or other countries.

The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.




Course Number: 2373A
Part Number: X08-45636
Released: 08/2001
                                     Programming with Microsoft® Visual Basic® .NET (Prerelease)                                    iii



Contents
           Introduction
           Course Materials...................................................................................................... 2
           Prerequisites ............................................................................................................ 3
           Course Outline......................................................................................................... 4
           Microsoft Certified Professional Program............................................................... 6
           Facilities .................................................................................................................. 8
           Module 1: Overview of the Microsoft .NET Platform
           Overview ................................................................................................................. 1
           What Is the Microsoft .NET Platform? ................................................................... 2
           What Is the .NET Framework?................................................................................ 5
           What Are the .NET Framework Components? ....................................................... 9
           What Are the Visual Basic .NET Enhancements? ................................................ 17
           Review................................................................................................................... 19
           Module 2: Development Environment Features
           Overview ................................................................................................................. 1
           Describing the Integrated Development Environment ............................................ 2
           Creating Visual Basic .NET Projects ...................................................................... 3
           Demonstration: Creating a Visual Basic .NET Project ......................................... 16
           Using Development Environment Features........................................................... 17
           Demonstration: Using the Visual Studio .NET IDE.............................................. 29
           Debugging Applications........................................................................................ 30
           Demonstration: Debugging a Project .................................................................... 37
           Compiling in Visual Basic .NET........................................................................... 38
           Lab 2.1: Exploring the Development Environment............................................... 42
           Review................................................................................................................... 47
           Module 3: Language and Syntax Enhancements
           Overview ................................................................................................................. 1
           Data Types............................................................................................................... 2
           Using Variables ....................................................................................................... 9
           Demonstration: Using Variables and Data Structures........................................... 20
           Functions, Subroutines, and Properties ................................................................. 21
           Lab 3.1: Working with Variables and Procedures................................................. 29
           Exception Handling............................................................................................... 36
           Demonstration: Structured Exception Handling.................................................... 48
           Lab 3.2: Implementing Structured Exception Handling........................................ 49
           Review................................................................................................................... 52
iv   Programming with Microsoft® Visual Basic® .NET (Prerelease)


                        Module 4: Object-Oriented Design for Visual Basic .NET
                        Overview ................................................................................................................. 1
                        Designing Classes.................................................................................................... 2
                        Practice: Deriving Classes from Use Cases........................................................... 10
                        Object-Oriented Programming Concepts .............................................................. 11
                        Advanced Object-Oriented Programming Concepts ............................................. 20
                        Using Microsoft Visio ........................................................................................... 25
                        Lab 4.1: Creating Class Diagrams from Use Cases............................................... 33
                        Review................................................................................................................... 41
                        Module 5: Object-Oriented Programming in Visual Basic .NET
                        Overview ................................................................................................................. 1
                        Defining Classes...................................................................................................... 2
                        Creating and Destroying Objects........................................................................... 16
                        Demonstration: Creating Classes........................................................................... 23
                        Lab 5.1: Creating the Customer Class................................................................... 24
                        Inheritance ............................................................................................................. 31
                        Demonstration: Inheritance ................................................................................... 43
                        Interfaces ............................................................................................................... 44
                        Demonstration: Interfaces and Polymorphism ...................................................... 50
                        Working with Classes............................................................................................ 51
                        Lab 5.2: Inheriting the Package Class ................................................................... 65
                        Review................................................................................................................... 74
                        Module 6: Using Windows Forms
                        Overview ................................................................................................................. 1
                        Why Use Windows Forms?..................................................................................... 2
                        Structure of Windows Forms................................................................................... 4
                        Using Windows Forms .......................................................................................... 12
                        Demonstration: Manipulating Windows Forms .................................................... 27
                        Using Controls....................................................................................................... 28
                        Demonstration: Implementing Drag-and-Drop Functionality ............................... 42
                        Windows Forms Inheritance.................................................................................. 43
                        Demonstration: Using Windows Forms Inheritance ............................................. 48
                        Lab 6.1: Creating the Customer Form................................................................... 49
                        Review................................................................................................................... 57
                        Module 7: Building Web Applications
                        Overview ................................................................................................................. 1
                        Introduction to ASP .NET ....................................................................................... 2
                        Creating Web Form Applications.......................................................................... 16
                        Demonstration: Creating Web Forms.................................................................... 30
                        Lab 7.1: Creating the Customer Logon Web Forms.............................................. 31
                        Building Web Services.......................................................................................... 42
                        Demonstration: Creating a Web Service ............................................................... 50
                        Using Web Services .............................................................................................. 51
                        Demonstration: Using a Web Service ................................................................... 57
                        Multimedia: How Web Services Work ................................................................. 58
                        Lab 7.2: Creating and Using the CustomerService Web Service.......................... 60
                        Review................................................................................................................... 70
                          Programming with Microsoft® Visual Basic® .NET (Prerelease)                                  v


Module 8: Using ADO .NET
Overview ................................................................................................................. 1
ADO .NET Overview.............................................................................................. 2
.NET Data Providers ............................................................................................... 5
Demonstration: Retrieving Data Using ADO .NET.............................................. 18
The DataSet Object ............................................................................................... 19
Practice: Using DataSets ....................................................................................... 35
Data Designers and Data Binding ......................................................................... 37
XML Integration.................................................................................................... 45
Demonstration: Using XML Schema .................................................................... 55
Lab 8.1: Creating Applications That Use ADO .NET........................................... 56
Review................................................................................................................... 69
Module 9: Developing Components in Visual Basic .NET
Overview ................................................................................................................. 1
Components Overview ............................................................................................ 2
Creating Serviced Components............................................................................. 11
Demonstration: Creating a Serviced Component.................................................. 27
Lab 9.1: Creating a Serviced Component.............................................................. 28
Creating Component Classes................................................................................. 35
Demonstration: Creating a Stopwatch Component ............................................... 40
Creating Windows Forms Controls ....................................................................... 41
Demonstration: Creating an Enhanced TextBox................................................... 48
Creating Web Forms User Controls ...................................................................... 49
Demonstration: Creating a Simple Web Forms User Control............................... 53
Lab 9.2: Creating a Web Forms User Control....................................................... 54
Threading .............................................................................................................. 60
Demonstration: Using the SyncLock Statement.................................................... 73
Review................................................................................................................... 74
Module 10: Deploying Applications
Overview ................................................................................................................. 1
Describing Assemblies............................................................................................ 2
Choosing a Deployment Strategy.......................................................................... 11
Deploying Applications......................................................................................... 18
Lab 10.1: Packaging a Component Assembly....................................................... 20
Demonstration: Deploying a Web-Based Application .......................................... 28
Lab 10.2: Deploying a Windows-Based Application............................................ 29
Review................................................................................................................... 33
Module 11: Upgrading to Visual Basic .NET
Overview ................................................................................................................. 1
Deciding Whether to Upgrade................................................................................. 2
Options for Upgrading............................................................................................. 7
Recommendations ................................................................................................. 11
Performing the Upgrade ........................................................................................ 13
Demonstration: Using the Upgrade Wizard .......................................................... 22
Review................................................................................................................... 23
                             Programming with Microsoft® Visual Basic® .NET (Prerelease)    vii



About This Course
             This section provides you with a brief description of the course, audience,
             suggested prerequisites, and course objectives.

             Description
             This five day instructor-led course provides students with the knowledge and
             skills needed to develop Microsoft® .NET–based applications by using
             Microsoft Visual Basic® .NET version 7.0. The course focuses on the new
             features and enhancements to Visual Basic.

             Audience
             This course is intended for experienced Visual Basic developers who want to
             upgrade to Visual Basic .NET.

             Student Prerequisites
             This course requires that students meet the following prerequisites:
             n   Experience developing applications with Visual Basic 4.0 or later
             n   Successful completion of Course 1013A, Mastering Microsoft
                 Visual Basic 6 Development or equivalent knowledge
                 OR
             n   Successful completion of Course 1016A, Mastering Enterprise
                 Development Using Microsoft Visual Basic 6 or equivalent knowledge
             n   Familiarity with basic concepts of object-oriented programming
             n   Familiarity with XML concepts
             n   Familiarity with Microsoft’s .NET strategy as described on Microsoft’s
                 .NET Web site: http://www.microsoft.com/net/
             n   Familiarity with the .NET Framework as described on the following Web
                 sites:
                 http://msdn.microsoft.com/msdnmag/issues/0900/Framework/
                 Framework.asp
                 and http://msdn.microsoft.com/msdnmag/issues/1000/Framework2/
                 Framework2.asp
viii   Programming with Microsoft® Visual Basic® .NET (Prerelease)


                         Course Objectives
                         After completing this course, the student will be able to:
                         n   List the major elements of the .NET Framework and describe some of the
                             major enhancements to the new version of Visual Basic.
                         n   Describe the basic structure of a Visual Basic .NET project and use the main
                             features of the integrated development environment (IDE).
                         n   Use the new language features and syntax in Visual Basic .NET.
                         n   Explain the basic concepts and terminology of object-oriented design
                             specifically for Visual Basic .NET.
                         n   Explain and use the basic concepts and terminology of object-oriented
                             programming in Visual Basic .NET.
                         n   Create applications by using Microsoft Windows® Forms.
                         n   Create Internet applications that use Web Forms and Web Services.
                         n   Create applications that use ADO .NET.
                         n   Create components in Visual Basic .NET.
                         n   Set up and deploy various types of Visual Basic .NET–based applications.
                         n   Prepare existing Visual Basic–based applications for upgrade to
                             Visual Basic .NET.
                               Programming with Microsoft® Visual Basic® .NET (Prerelease)   ix



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: Overview of the Microsoft .NET Platform
                10:30   10:45       Break
                10:45   11:45       Module 2: Development Environment Features
                11:45   12:45       Lunch
                12:45   1:30        Lab 2.1: Exploring the Development Environment
                1:30    2:45        Module 3: Syntax and Language Enhancements
                2:45    3:00        Break
                3:00    3:45        Lab 3.1: Working with Variables and Procedures
                3:45    4:15        Lab 3.2: Implementing Structured Exception Handling

            Day 2
                Start   End         Module
                9:00    9:30        Day 1 review
                9:30    10:45       Module 4: Object-Oriented Design for Visual Basic .NET
                10:45   11:00       Break
                11:00   11:45       Lab 4.1: Creating Class Diagrams from Use Cases
                11:45   12:45       Lunch
                12:45   2:15        Module 5: Object-Oriented Programming in Visual Basic .NET
                2:15    2:30        Break
                2:30    3:15        Lab 5.1: Creating the Customer Class
                3:15    4:15        Lab 5.2: Inheriting the Package Class
x   Programming with Microsoft® Visual Basic® .NET (Prerelease)


                        Day 3
                           Start     End        Module
                           9:00      9:30       Day 2 review
                           9:30      10:45      Module 6: Using Windows Forms
                           10:45     11:00      Break
                           11:00     11:45      Lab 6.1: Creating the Customer Form
                           11:45     12:45      Lunch
                           12:45     2:45       Module 7: Building Web Applications
                           2:45      3:00       Break
                           3:00      4:00       Lab 7.1: Creating the Customer Logon Web Forms
                           4:00      4:45       Lab 7.2: Creating and Using the CustomerService Web Service

                        Day 4
                           Start     End        Module
                           9:00      9:30       Day 3 review
                           9:30      10:30      Module 8: Using ADO .NET
                           10:30     10:45      Break
                           10:45     11:45      Module 8: Using ADO .NET
                           11:45     12:45      Lunch
                           12:45     1:45       Lab 8.1: Creating Applications That Use ADO .NET
                           1:45      3:15       Module 9: Developing Components in Visual Basic .NET
                           3:15      3:30       Break
                           3:30      4:30       Lab 9.1: Creating a Serviced Component
                           4:30      5:00       Lab 9.2: Creating a Web Forms User Control

                        Day 5
                           Start     End        Module
                           9:00      9:30       Day 4 review
                           9:30      10:45      Module 10: Deploying Applications
                           10:45     11:00      Break
                           11:00     11:15      Lab 10.1: Packaging a Component Assembly
                           11:15     12:00      Lab 10.2: Deploying a Windows Application
                           12:00     1:00       Lunch
                           1:00      2:00       Module 11: Upgrading to Visual Basic .NET
                           2:00      3:00       Course Wrap-up
                               Programming with Microsoft® Visual Basic® .NET (Prerelease)       xi



Trainer Materials Compact Disc Contents
             The Trainer Materials compact disc contains the following files and folders:
             n   Autorun.exe. When the compact disc is inserted into the CD-ROM 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, or install Microsoft Internet Explorer.
             n   Default.htm. This file opens the Trainer Materials Web page.
             n   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.
             n   2373A_ms.doc. This file is the Manual Classroom Setup Guide. It contains
                 the steps for manually installing the classroom computers.
             n   Errorlog. This folder may contain an error log. If there are no known errors
                 in the course, the error log does not appear. The HTML file in this folder is
                 viewable through the Trainer Materials compact disc interface.
             n   Fonts. This folder contains fonts that are required to view the Microsoft
                 PowerPoint® presentation and Web-based materials.
             n   Menu. This folder contains elements for Autorun.exe.
             n   Mplayer. This folder contains the setup file to install Microsoft Windows
                 Media™ Player.
             n   Powerpnt. This folder contains the PowerPoint slides that are used in this
                 course.
             n   Pptview. This folder contains the PowerPoint Viewer, which is used to
                 display the PowerPoint slides
             n   Setup. This folder contains the files that install the course and related
                 software to computers in a classroom setting.
             n   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.
             n   Tools. This folder contains files and utilities used to complete the setup of
                 the instructor computer.
             n   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.
xii   Programming with Microsoft® Visual Basic® .NET (Prerelease)



Student Materials Compact Disc Contents
                         The Student Materials compact disc contains the following files and folders:
                         n   Autorun.exe. When the compact disc is inserted into the CD-ROM drive, or
                             when you double-click the Autorun.exe file, this file opens the compact
                             disc and allows you to browse the Student Materials compact disc or install
                             Internet Explorer.
                         n   Default.htm. This file opens the Student Materials Web page. It provides
                             you with resources pertaining to this course, including additional reading,
                             review and lab answers, lab files, multimedia presentations, and course-
                             related Web sites.
                         n   Readme.txt. This file explains how to install the software for viewing the
                             Student Materials compact disc and its contents and how to open the
                             Student Materials Web page.
                         n   2373A_ms.doc. This file is the Manual Classroom Setup Guide. It contains a
                             description of classroom requirements, classroom setup instructions, and the
                             classroom configuration.
                         n   Addread. This folder contains additional reading pertaining to this course. If
                             there are no additional reading files, this folder does not appear.
                         n   Appendix. This folder contains appendix files for this course. If there are no
                             appendix files, this folder does not appear.
                         n   Democode. This folder contains demonstration code. If there is no
                             demonstration code, this folder does not appear.
                         n   Flash. This folder contains the installer for the Macromedia Flash 5.0
                             browser plug-in. If there are no Flash animations in the course, this folder
                             does not appear.
                         n   Fonts. This folder contains fonts that are required to view the PowerPoint
                             presentation and Web-based materials.
                         n   Ie5. This folder contains Internet Explorer 5.
                         n   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.
                         n   Media. This folder contains files that are used in multimedia presentations
                             for this course. If this course does not include any multimedia presentations,
                             this folder does not appear.
                         n   Menu. This folder contains elements for Autorun.exe.
                         n   Mplayer. This folder contains files that are required to install Windows
                             Media Player.
                         n   Practices. This folder contains files that are used in the hands-on practices.
                             If there are no practices, this folder does not appear.
                         n   Sampapps. This folder contains the sample applications associated with this
                             course. If there are no associated sample applications, this folder does not
                             appear.
                Programming with Microsoft® Visual Basic® .NET (Prerelease)       xiii


n   Sampcode. This folder contains sample code that is accessible through the
    Web pages on the Student Materials compact disc. If there is no sample
    code, this folder does not appear.
n   Sampsite. This folder contains files that create the sample site associated
    with this course. If there is no sample site, this folder does not appear.
n   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.
n   Wordview. This folder contains the Word Viewer that is used to view any
    Word document (.doc) files that are included on the compact disc.
xiv   Programming with Microsoft® Visual Basic® .NET (Prerelease)



Document Conventions
                        The following conventions are used in course materials to distinguish elements
                        of the text.
                        Convention                   Use

                        u                            Indicates an introductory page. This symbol appears next
                                                     to a topic heading when additional information on the
                                                     topic is covered on the page or pages that follow it.
                        bold                         Represents commands, command options, and syntax that
                                                     must be typed exactly as shown. It also indicates
                                                     commands on menus and buttons, dialog box titles and
                                                     options, and icon and menu names.
                        italic                       In syntax statements or descriptive text, indicates
                                                     argument names or placeholders for variable information.
                                                     Italic is also used for introducing new terms, for book
                                                     titles, and for emphasis in the text.
                        Title Capitals               Indicate domain names, user names, computer names,
                                                     directory names, and folder and file names, except when
                                                     specifically referring to case-sensitive names. Unless
                                                     otherwise indicated, you can use lowercase letters when
                                                     you type a directory name or file name in a dialog box or
                                                     at a command prompt.
                        ALL CAPITALS                 Indicate the names of keys, key sequences, and key
                                                     combinations — for example, ALT+SPACEBAR.
                        monospace                    Represents code samples or examples of screen text.
                        []                           In syntax statements, enclose optional items. For example,
                                                     [filename] in command 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 that the preceding item may
                                                     be repeated.
                        .                            Represents an omitted portion of a code sample.
                        .
                        .
                                                          Introduction


Contents

Introduction                                                 1
Course Materials                                             2
Prerequisites                                                3
Course Outline                                               4
Course Outline (continued)                                   5
Microsoft Certified Professional Program                     6
Facilities                                                   8




This course is based on the prerelease version (Beta 2) of Microsoft® Visual Studio® .NET
Enterprise Edition. Content in the final release of the course may be different from the
content included in this prerelease version. All labs in the course are to be completed with
the Beta 2 version of Visual Studio .NET Enterprise Edition.
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, place or event 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 Microsoft Corporation. All rights reserved.

Microsoft, MS-DOS, Windows, Windows NT, ActiveX, BizTalk, FrontPage, IntelliSense, JScript,
Microsoft Press, Outlook, PowerPoint, Visio, Visual Basic, Visual C++, Visual C#, Visual
InterDev, Visual Studio, and Windows Media are either registered trademarks or trademarks of
Microsoft Corporation in the United States and/or other countries.

The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
                                                                           Introduction         iii



Instructor Notes
Presentation:   The Introduction module provides students with an overview of the course
30 Minutes      content, materials, and logistics for Course 2373A, Programming with
                Microsoft® Visual Basic® .NET (Prerelease).


Course Materials and Preparation
                Required Materials
                To teach this course, you need the following materials:
                n   Delivery Guide
                n   Trainer Materials compact disc

                Preparation Tasks
                To prepare for this course, you must:
                • Complete the Course Preparation Checklist that is included with the trainer
                  course materials.
iv   Introduction



Module Strategy
                    Use the following strategy to present this module:
                    n   Course 2373A: Programming with Microsoft Visual Basic .NET
                        (Prerelease)
                        Show the slide that displays the course number and course title.
                    n   Introduction
                        Welcome students to the course and introduce yourself. Provide a brief
                        overview of your background to establish credibility.
                        Have students introduce themselves and provide their background, product
                        experience, and expectations of the course.
                        Record student expectations on a whiteboard or flip chart that you can
                        reference later in class.
                    n   Course Materials
                        Explain the purpose of all materials used in this course.
                    n   Prerequisites
                        Provide the students with the list of prerequisites that they should have met
                        before taking this course. This is an opportunity for you to identify students
                        who may not have the appropriate background or experience to attend this
                        course.
                    n   Course Outline
                        Provide an overview of each module and what students will learn.
                        Explain how this course will meet students’ expectations by relating the
                        information covered in individual modules to their expectations.
                    n   Setup
                        Provide the students with any necessary setup information for the course.

                        Note By default, the lab and demo files are installed in the folders located
                        at C:\Program Files\Msdntrain\2373\Labs and C:\Program Files\
                        Msdntrain\2373\Demo. The setup script uses this location to create IIS
                        virtual directories. If you modify the installation path, you will also need to
                        modify the setup script to match your new path.

                    n   Microsoft Certified Professional Program
                        Inform students about the Microsoft Certified Professional (MCP) program
                        and the various certification options.
                    n   Facilities
                        Explain the facility information for the training site.
                                                                          Introduction   1



Introduction
Topic Objective
To introduce yourself,
establish credibility, meet
students, and set student
                                n   Name
expectations for the course.    n   Company Affiliation
Lead-in
Good morning. Welcome to        n   Title/Function
Programming with Microsoft
Visual Basic .NET
                                n   Job Responsibility
(Prerelease).                   n   Visual Basic Programming Experience
My name is...                   n   Expectations for the Course




Introduce yourself.

Provide a brief overview of
your background to
establish credibility as a
Visual Basic .NET instructor.

Ask students to introduce
themselves, addressing the
bulleted items on the slide.
Delivery Tip
As students introduce
themselves, use a
whiteboard or flip chart to
record their expectations of
the course.
2         Introduction



Course Materials
Topic Objective
To identify and describe the
course materials.
Lead-in                                n   Name Card
We have provided                       n   Student Workbook
everything you need for this
course. You will find the              n   Student Materials Compact Disc
following materials at your
desk.                                  n   Course Evaluation




Describe the contents of the   The following materials are included with your kit:
student workbook and the
Student Materials compact      n   Name card. Write your name on both sides of the name card.
disc.                          n   Student workbook. The student workbook contains the material covered in
                                   class, in addition to the hands-on lab exercises.
Have students write their
names on both sides of the     n   Student Materials compact disc. The Student Materials compact disc
name card.                         contains the Web page that provides you with links to resources pertaining
                                   to this course, including additional readings, review and lab answers, lab
Tell students that a course        files, multimedia presentations, and course-related Web sites.
evaluation must be
completed at the end of the
                                   Note To open the Web page, insert the Student Materials compact disc into
course.
                                   the CD-ROM drive, and then in the root directory of the compact disc,
Tell students where they           double-click Autorun.exe or Default.htm.
can send comments with
feedback on this course.       n   Course evaluation. To provide feedback on the instructor, course, and
Delivery Tip                       software product, send e-mail to mstrain@microsoft.com. Be sure to type
Demonstrate how to open            Course 2373A in the subject line. Your comments will help us improve
the Web page provided on           future courses.
the Student Materials
compact disc. On the               To provide additional comments or inquire about the Microsoft Certified
Trainer Materials compact          Professional program, send e-mail to mcp@msprograms.com.
disc, double-click
Autorun.exe or
Default.htm in the
StudentCD folder.
                                                                                               Introduction       3



Prerequisites
Topic Objective
To present and describe the
prerequisites for this course.
Lead-in                                    n   Experience Developing Applications in Visual Basic 4.0
The following prerequisite                     or Later
knowledge is needed for this
course.
                                           n   Familiarity with Microsoft’s .NET Strategy
                                           n   Familiarity with the Microsoft .NET Framework




                                 This course requires that you meet the following prerequisites:
                                 n   Experience developing applications in Microsoft Visual Basic® 4.0 or later
                                 n   Successful completion of Course 1013A, Mastering Microsoft
                                     Visual Basic 6 Development, or equivalent knowledge
                                     OR
                                 n   Successful completion of course 1016A, Mastering Enterprise Development
                                     Using Microsoft Visual Basic 6, or equivalent knowledge
                                 n   Familiarity with basic object-oriented concepts
                                 n   Familiarity with Extensible Markup Language (XML)
                                 n   Familiarity with Microsoft’s .NET strategy as described on Microsoft’s
                                     .NET Web site (http://www.microsoft.com/net/)
                                 n   Familiarity with the .NET Framework as described on the following Web
                                     sites:
                                     http://msdn.microsoft.com/msdnmag/issues/0900/Framework/
                                     Framework.asp
                                     and
                                     http://msdn.microsoft.com/msdnmag/issues/1000/Framework2/
                                     Framework2.asp
4         Introduction



Course Outline
Topic Objective
To provide an overview of
each module and what
students will learn.                 n   Module 1: Overview of the Microsoft .NET Platform
Lead-in                              n   Module 2: Development Environment Features
In this course, we will
cover...                             n   Module 3: Language and Syntax Enhancements
                                     n   Module 4: Object-Oriented Design for Visual Basic .NET
                                     n   Module 5: Object-Oriented Programming in
                                         Visual Basic .NET




Briefly describe each        Module 1, “Overview of the Microsoft .NET Platform,” describes the rationale
module.                      and features that provide the foundation for the .NET platform, including the
                             .NET components. The purpose of this module is to build an understanding of
As you describe each         the .NET platform for which you will be developing Visual Basic .NET version
module, acknowledge any      7.0 code. After completing this module, you will be able to describe the
information that will meet   components of the .NET platform.
the student expectations
that you recorded earlier.   Module 2, “Development Environment Features,” describes the major benefits
                             of the new integrated development environment (IDE) and the basic structure of
                             a Visual Basic .NET–  based application. You will learn how to create projects in
                             Visual Basic .NET, and will try some of the tools that make the IDE powerful
                             for application development. Finally, you will learn how to debug your projects
                             and how to compile them.
                             Module 3, “Language and Syntax Enhancements,” describes the many language
                             and syntax enhancements available in Visual Basic .NET. You will learn how
                             these enhancements help make it an excellent development tool for the .NET
                             platform.
                             Module 4, “Object-Oriented Design for Visual Basic .NET,” describes how to
                             begin the class design process by using use cases. You will then learn about
                             some common object-oriented programming concepts, including inheritance,
                             interfaces, and polymorphism. Finally, you will see how to document your
                             system design.
                             Module 5, “Object-Oriented Programming in Visual Basic .NET,” provides
                             information on how to implement object-oriented programming in
                             Visual Basic .NET–   based applications. You will learn how to define classes,
                             their properties, and their methods. You will learn about the life cycle of an
                             object, from creation to destruction. You will also learn how to work with
                             classes by using inheritance, interfaces, polymorphism, shared members,
                             events, and delegates.
                                                                            Introduction        5



Course Outline (continued)


                      n   Module 6: Using Windows Forms
                      n   Module 7: Building Web Applications
                      n   Module 8: Using ADO .NET
                      n   Module 9: Developing Components in Visual Basic .NET
                      n   Module 10: Deploying Applications
                      n   Module 11: Upgrading to Visual Basic .NET




              Module 6, “Using Windows Forms,” describes how to use the new features
              available in Microsoft Windows® Forms and how to make changes to forms and
              controls, and to their properties, methods, and events. You will also learn how
              to create some of the standard Windows dialog boxes. Finally, you will learn
              about visual inheritance, which allows you to use object-oriented techniques
              within your forms.
              Module 7, “Building Web Applications,” explains how to create dynamic,
              powerful Web applications by using the ASP .NET framework. You will learn
              how to use Web Services from a browser or from another client application.
              Module 8, “Using ADO .NET,” explains how to use ADO .NET. You will learn
              about the Microsoft .NET providers included in the .NET Framework and about
              how to use the DataSet object. You will also learn how to use the Microsoft
              Visual Studio .NET data designers and how to bind data to Microsoft
              Windows® Forms and Web Forms. Finally, you will learn about the integration
              of Extensible Markup Language (XML) with ADO .NET.
              Module 9, “Developing Components in Visual Basic .NET,” describes the
              different types of components that can be created in Visual Basic .NET,
              including component classes and serviced components. This module also
              explains how to enhance your applications by using threading.
              Module 10, “Deploying Applications,” explains how to deploy assemblies for
              use by client applications, how to decide what type of distribution strategy to
              implement, and how to deploy Windows-based and Web-based applications.
              Module 11, “Upgrading to Visual Basic .NET,” explains the factors you must
              consider when deciding whether to upgrade an existing application, the options
              you have for upgrading, and how to use the Upgrade Wizard.

              Note The information in this course is based on the prerelease (Beta 2) version
              of Microsoft Visual Studio .NET.
6         Introduction



Microsoft Certified Professional Program
Topic Objective
To provide students with
information about the
Microsoft Certified
Professional Program.
Lead-in
The Microsoft Certified
Professional Program
includes these
certifications…

                                         http://www.microsoft.com/trainingandservices/




                           The Microsoft Certified Professional program includes the following
                           certifications:
                           n   Microsoft Certified Systems Engineer (MCSE)
                           n   Microsoft Certified Database Administrator (MCDBA)
                           n   Microsoft Certified Solution Developer (MCSD)
                           n   Microsoft Certified Professional + Site Building (MCP + Site Building)
                           n   Microsoft Certified Professional (MCP)
                           n   Microsoft Certified Trainer (MCT)


                           For More Information See the Microsoft Training and Certification Web site at
                           http://www.microsoft.com/trainingandservices/
                           You can also send e-mail to mcp@msprograms.com if you have specific
                           certification questions.
                                                            Introduction      7


Preparing for an MCP Exam
MSDN Training curriculum helps you prepare for Microsoft Certified
Professional (MCP) exams. However, no one-to-one correlation exists between
MSDN Training courses and MCP exams. Microsoft does not expect or intend
for MSDN Training to be the sole preparation tool for passing an MCP exam.
Practical product knowledge and experience is also necessary to pass an MCP
exam.
To help prepare for the MCP exams, you can use the preparation guides that are
available for each exam. Each Exam Preparation Guide contains exam-specific
information, such as a list of the topics on which you will be tested. These
guides are available on the Microsoft Certified Professional Web site at
http://www.microsoft.com/trainingandservices/
8         Introduction



Facilities
Topic Objective
To inform students of class                                Class Hours
logistics and rules for the
training site.
Lead-in                                   Building Hours                 Phones
Before we start, let’s go over
the class logistics.
                                          Parking                        Messages



                                          Rest Rooms                     Smoking



                                          Meals                          Recycling




Explain the class hours,
extended building hours for
labs, parking, restroom
location, meals, phones,
message posting, and
where smoking is or is not
allowed.

Let students know if your
facility has Internet access
that is available for them to
use during class breaks.

Also make sure that the          THIS PAGE INTENTIONALLY LEFT BLANK
students are aware of the
recycling program if one is
available.
                                                          Module 1: Overview of
                                                          the Microsoft .NET
                                                          Platform
Contents

Overview                                                     1
What Is the Microsoft .NET Platform?                         2
What Is the .NET Framework?                                  5
What Are the .NET Framework Components? 9
What Are the Visual Basic .NET
Enhancements?                                              17
Review                                                     19




This course is based on the prerelease version (Beta 2) of Microsoft® Visual Studio® .NET
Enterprise Edition. Content in the final release of the course may be different from the
content included in this prerelease version. All labs in the course are to be completed with
the Beta 2 version of Visual Studio .NET Enterprise Edition.
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, place or event 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 Microsoft Corporation. All rights reserved.

Microsoft, MS-DOS, Windows, Windows NT, ActiveX, BizTalk, FrontPage, IntelliSense, JScript,
Microsoft Press, Outlook, PowerPoint, Visio, Visual Basic, Visual C++, Visual C#, Visual
InterDev, Visual Studio, and Windows Media are either registered trademarks or trademarks of
Microsoft Corporation in the United States and/or other countries.

The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
                                            Module 1: Overview of the Microsoft .NET Platform      iii



Instructor Notes
Presentation:   This module provides students with an overview of the Microsoft® .NET
60 Minutes      Platform. It defines some of the terminology specific to the .NET Platform and
                describes its key features and benefits.
Lab:
00 Minutes      The module starts with an overview of the .NET Platform, and then introduces
                the .NET Framework and services. It describes the design goals of the .NET
                Framework and provides other information about the major components.
                Finally, students will learn about the programming languages that can be used
                with the .NET Framework and about the major enhancements to Microsoft
                Visual Basic® .NET version 7.0.
                This module contains no labs.
                After completing this module, students will be able to:
                n   List the main elements of the .NET Platform.
                n   Describe the .NET Framework and its components.
                n   List the major enhancements to Visual Basic .NET.


Materials and Preparation
                This section provides the materials and preparation tasks that you need to teach
                this module.

                Required Materials
                To teach this module, you need the following materials:
                n   Microsoft PowerPoint® file 2373A_01.ppt
                n   Module 1, “Overview of the Microsoft .NET Platform”


                Preparation Tasks
                To prepare for this module, you should:
                n   Read all of the materials for this module.
                n   Read the instructor notes and the margin notes for the module.
iv   Module 1: Overview of the Microsoft .NET Platform



Module Strategy
                         This first module must set the tone for the rest of the course. Visual Basic
                         developers may initially be hesitant to upgrade their skills to Visual Basic .NET
                         because of the substantial changes to the product. While it may take students a
                         bit longer to adapt to this version of Visual Basic, the advantages are
                         significant, and these advantages must be made clear to students from the very
                         beginning. Use the following strategy to present this module:
                         n   What Is the Microsoft .NET Platform?
                             Discuss the core services and technologies provided by the .NET Platform.
                             Briefly talk about the .NET Framework. It is covered in more detail in the
                             next lesson.
                         n   What Is the .NET Framework?
                             Ensure that students understand the function that the Common Language
                             Specification plays in language development for the .NET Platform. Stress
                             the fact that the existing model provides no consistency in the availability of
                             application programming interfaces (APIs). The choice of programming
                             model also becomes the choice of language. So if you are a Visual Basic
                             developer, you are limited by the set of functionality that it provides for the
                             platform. Or if you are a C++ developer, your existing skills do not transfer
                             to Active Server Pages (ASP) development.
                             However, because this course focuses on Visual Basic development, point
                             out that most students will already be familiar with many .NET concepts,
                             such as ASP development and Web Services, Microsoft Visual Basic
                             Scripting Edition, and Simple Object Access Protocol (SOAP)/
                             Visual Basic 6.0.
                             Mention that Visual Basic has been upgraded significantly to support the
                             .NET Platform. Explain that C# is a new language specifically created for
                             the .NET Framework and that C++ has been enhanced to support the .NET
                             Platform. Point out that several third-party languages are also .NET enabled,
                             and that more will follow over time.
                         n   What Are the .NET Framework Components?
                             Briefly describe each of the .NET Framework components. Point out to the
                             students each area where Visual Basic developers can benefit from the .NET
                             Framework components, such as garbage collection, type checking, and
                             exception handling.
                             ADO .NET is also an important new tool for Visual Basic .NET developers,
                             and they should not find this tool difficult if they are familiar with previous
                             versions of ActiveX® Data Objects (ADO).
                             Web Forms and Web Services are of course some of the major new features
                             of the .NET Platform. Students should be aware that they no longer need to
                             learn a scripting language in order to create Web applications; they can now
                             use Visual Basic .NET, using their existing Visual Basic skills.
                             Microsoft Windows-based applications are not to be forgotten in
                             Visual Basic .NET. Students need to realize that there are many new and
                             exciting aspects of the new Windows® Forms development.
                           Module 1: Overview of the Microsoft .NET Platform   v


n   What Are the Visual Basic .NET Enhancements?
    Point out that the course focuses on Microsoft Visual Studio® .NET from
    the perspective of a Visual Basic developer. Describe the main areas of
    enhancement, but make it clear that they are covered in detail in the
    remainder of the course.
                                                            Module 1: Overview of the Microsoft .NET Platform     1



Overview
Topic Objective
To provide an overview of
the module topics and
objectives.                             n   What Is the Microsoft .NET Platform?
Lead-in                                 n   What Is the .NET Framework?
In this module, you will be
introduced to the .NET                  n   What Are the .NET Framework Components?
Platform. You will then learn
about the .NET Framework                n   What Are the Visual Basic .NET Enhancements?
and the language support
that the .NET Framework
provides for the platform.




                                Microsoft® Visual Basic® .NET version 7.0 is a major enhancement to the
Delivery Tip                    Visual Basic product line. As a Visual Basic developer, you will find it useful
This module provides an
overview of the .NET
                                to understand the rationale and features that provide the foundation for the
systems for Visual Basic        Microsoft .NET Platform before you look at Visual Basic .NET in detail.
developers.
                                After completing this module, you will be able to:
Make sure to point out the      n   List the main elements of the .NET Platform.
advantages of .NET over
previous versions of            n   Describe the .NET Framework and its components.
Windows development             n   List the major enhancements to Visual Basic .NET.
architectures and
Visual Basic whenever
possible.
2         Module 1: Overview of the Microsoft .NET Platform



What Is the Microsoft .NET Platform?
Topic Objective
To discuss the core services
and features provided by the
.NET Platform.                                                                         Internet
Lead-in
                                                                Visual Studio .NET
The .NET Platform consists                                        Orchestration
of several core services and
features, as shown on this                                    Internet      .NET         Building
slide. One goal of this new               .NET
                                                                          Enterprise      Block
platform is to simplify Web               Framework           COM+                       Services
development. This topic will                                               Servers
provide a brief look at the
architecture of the .NET                                             Windows
Platform.
                                                    Available        With .NET          New
                                                    Today            Enhancements       Capabilities




                               This topic describes the components of the .NET Platform, including the .NET
                               Framework, the .NET Building Block Services, .NET Enterprise Servers, and
                               Microsoft Visual Studio® .NET. The .NET Platform is important to you because
                               the goal of the .NET Platform is to simplify Web development by providing all
                               of the tools and technologies that you need to build distributed Web
                               applications.
                               The .NET Platform provides:
                               n   A language-independent, consistent programming model across all tiers of
                                   an application.
                               n   Seamless interoperability between technologies.
                               n   Easy migration from existing technologies.
                               n                                s
                                   Full support for the Internet’ platform-neutral, standards-based
                                   technologies, including Hypertext Transfer Protocol (HTTP), Extensible
                                   Markup Language (XML), and Simple Object Access Protocol (SOAP).

                               The .NET Platform
                               The .NET Platform is a set of technologies designed to transform the Internet
                               into a full-scale distributed computing platform. It provides new ways to build
                               applications from collections of Web Services. The .NET Platform fully
                               supports the existing Internet infrastructure, including HTTP, XML, and SOAP.
                                                             Module 1: Overview of the Microsoft .NET Platform       3


                                 Core Technologies in the .NET Platform
                                 The core technologies that make up the .NET Platform include:
                                 n   .NET Framework
                                     The .NET Framework is based on a new common language runtime. This
Delivery Tip                         runtime provides a common set of services for projects built in
Because of the common
language runtime, all .NET-
                                     Visual Studio .NET, regardless of the language. These services provide key
compatible languages will            building blocks for applications of any type, across all application tiers.
use the same run-time files.         Microsoft Visual Basic, Microsoft Visual C++® , and other Microsoft
This greatly aids                    programming languages have been enhanced to take advantage of these
Visual Basic developers              services. Third-party languages that are written for the .NET Platform also
because they will no longer
                                     have access to the same services.
need to distribute run-time
libraries that are specific to
Visual Basic. These files will       Note Because of the common language runtime, all .NET languages will
be installed automatically in        use the same run-time files. This means that there is no need to distribute
future versions of Windows.          Visual Basic– specific run-time libraries because .NET run-time files will be
                                     installed automatically in future versions of Microsoft Windows® .

                                 n   .NET Building Block Services
                                     The .NET Building Block Services are distributed programmable services
                                     that are available both online and offline. A service can be invoked on a
                                     stand-alone computer not connected to the Internet, provided by a local
                                     server running inside a company, or accessed by means of the Internet. The
                                     .NET Building Block Services can be used from any platform that supports
                                     SOAP. Services include identity, notification and messaging,
                                     personalization, schematized storage, calendar, directory, search, and
                                     software delivery.
                                 n   Visual Studio .NET
                                     Visual Studio .NET provides a high-level development environment for
                                     building applications on the .NET Framework. It provides key enabling
                                     technologies to simplify the creation, deployment, and ongoing evolution of
                                     secure, scalable, highly available Web applications and Web Services. It
                                     also enables a new generation of Windows-based applications with many
                                     new features available through the .NET Framework.
4   Module 1: Overview of the Microsoft .NET Platform


                        n   .NET Enterprise Servers
                            The .NET Enterprise Servers provide scalability, reliability, management,
                            and integration within and across organizations, and many other features as
                            described in the following table.
         Server                          Description

         Microsoft                       Includes rich XML functionality, support for Worldwide Web
         SQL Server™ 2000                Consortium (W3C) standards, the ability to manipulate XML
                                         data by using Transact SQL (T-SQL), flexible and powerful
                                         Web-based analysis, and secure access to your data over the
                                         Web by using HTTP.
         Microsoft                       Provides enterprise application integration (EAI), business-to-
         BizTalk™ Server 2000            business integration, and the advanced BizTalk Orchestration
                                         technology to build dynamic business processes that span
                                         applications, platforms, and organizations over the Internet.
         Microsoft Host Integration      Provides the best way to embrace Internet, intranet, and
         Server 2000                     client/server technologies while preserving investments in
                                         existing systems. Microsoft Host Integration Server 2000 is the
                                         replacement for SNA Server.
         Microsoft Exchange 2000         Builds on the powerful Exchange messaging and collaboration
         Enterprise Server               technology by introducing several important new features and
                                         further increasing the reliability, scalability, and performance of
                                         its core architecture. Other features enhance the integration of
                                         Exchange 2000 with Microsoft Windows 2000, Microsoft
                                         Office 2000, and the Internet.
         Microsoft Application           Provides a deployment and management tool for high-
         Center 2000                     availability Web applications.
         Microsoft Internet Security     Provides secure, fast, and manageable Internet connectivity.
         and Acceleration Server         Internet Security and Acceleration Server integrates an
         2000                            extensible, multilayer enterprise firewall and a scalable, high-
                                         performance Web cache. It builds on Windows 2000 security
                                         and directory for policy-based security, acceleration, and
                                         management of internetworking.
         Microsoft                       Provides an application framework, sophisticated feedback
         Commerce Server 2000            mechanisms, and analytical capabilities.
                                                          Module 1: Overview of the Microsoft .NET Platform     5



u What Is the .NET Framework?
Topic Objective
To provide an overview of
the topics covered in this
lesson.                               n   Overview of the .NET Framework
Lead-in                               n   Benefits of the .NET Framework
The .NET Framework
provides all the common               n   Languages in the .NET Framework
services you need to enable
your applications to run.




                              In this lesson, you will learn how the .NET Framework provides all common
                              services required for your applications to run. You will learn how services are
                              available in any .NET-compatible language through the common language
                              specification (CLS). You will also learn what languages are supported in the
                              .NET Framework.
6         Module 1: Overview of the Microsoft .NET Platform



Overview of the .NET Framework
Topic Objective
To explain how various
components of the .NET
Framework fit together.
Lead-in                                 Visual
                                                    C++       C#    JScript®
                                                                    JScript®     …
The .NET Framework                      Basic




                                                                                             Visual Studio .NET
                                                                                             Visual Studio .NET
provides all common
services required to run your                    Common Language Specification
Visual Basic .NET
applications. These services
are available in any .NET-
compatible language                                       .NET Framework
through the Common
Language Specification.




                                The .NET Framework provides all the common services required to run your
                                Visual Basic .NET applications.

                                Building Components in the .NET Framework
                                Before COM, applications were completely separate entities with little or no
                                integration. Using COM, you can integrate components within and across
                                applications by exposing common interfaces. However, as a developer, you
                                must still write the code to wrap, manage, and clean up after components and
                                objects.
                                In the .NET Framework, components are built on a common foundation. You
                                no longer need to write the code to allow objects to interact directly with each
                                other. In the .NET environment, you no longer need to write component
                                wrappers because components do not use wrappers. The .NET Framework can
                                interpret the constructs that developers are accustomed to using in object-
                                oriented languages. The .NET Framework fully supports class, inheritance,
                                methods, properties, events, polymorphism, constructors, and other object-
                                oriented constructs.

                                The Common Language Specification
                                The Common Language Specification (CLS) defines the common standards to
                                which languages and developers must adhere if they want their components and
                                applications to be widely useable by other .NET-compatible languages. The
                                CLS allows Visual Basic .NET developers to create applications as part of a
                                multiple-language team with the knowledge that there will be no problems
                                integrating the different languages. The CLS even allows Visual Basic .NET
                                developers to inherit from classes defined in different languages.

                                Visual Studio .NET
                                In the .NET Framework, Visual Studio .NET provides the tools you can use for
                                rapid application development.
                                                             Module 1: Overview of the Microsoft .NET Platform   7



Benefits of the .NET Framework
Topic Objective
To explain how the                      n   Based on Web Standards and Practices
framework design goals
make it easy to build                   n   Extensible
applications.
                                        n   Easy for Developers to Use
Lead-in
Before you learn about the              n   Designed Using Unified Application Models
various .NET Framework
components, it is helpful to
understand the design goals                                     .NET Framework
of the .NET Framework.
This will help you to see
how the .NET Framework                  Visual Basic Forms          MFC/ATL                  ASP
simplifies software
development.
                                                                  Windows API




                               In this topic, you will learn about some of the benefits of the .NET Framework.

                               Goals of the .NET Framework
                               The .NET Framework was designed to meet the following goals:
                               n   Based on Web standards and practices
                                   The .NET Framework fully supports the existing Internet technologies,
                                   including Hypertext Markup Language (HTML), XML, SOAP, Extensible
                                   Stylesheet Language for Transformations (XSLT), XPath, and other Web
                                   standards. The .NET Framework favors loosely connected, stateless Web
                                   services.
                               n   Extensible
Delivery Tip
Mention that .NET                  The hierarchy of the .NET Framework is not hidden from the developer.
Framework classes that are         You can access and extend .NET classes (unless they are sealed) by using
sealed cannot be extended.         inheritance. You can also implement cross-language inheritance.
                               n   Easy for developers to use
                                   In the .NET Framework, code is organized into hierarchical namespaces and
                                   classes. The Framework provides a common type system, referred to as the
                                   unified type system, that is used by any .NET-compatible language. In the
                                   unified type system, everything is an object. There are no variant types,
                                   there is only one string type, and all string data is Unicode.
                               n   Designed using unified application models
                                   A .NET class’ functionality is available from any .NET-compatible
                                   language or programming model.
8         Module 1: Overview of the Microsoft .NET Platform



Languages in the .NET Framework
Topic Objective
To discuss the languages                 n   Visual Basic .NET
that are supported in the
.NET Framework.                              New version of Visual Basic with substantial language
Lead-in                                        innovations
In this topic, you will learn            n   C# – Designed for .NET
about the languages that
Microsoft is providing for the               New component-oriented language
.NET Framework with
Visual Studio .NET. You’ll               n   Managed Extensions to Visual C++
also learn about some of the
languages for .NET that are
                                             Provides more power and control
being created by third-party             n   JScript .NET
developers.
                                             Provides improved performance and productivity
                                         n   Third-party Languages



                                 The .NET Platform is language neutral— all common services needed to enable
                                 programs to run are provided by the .NET Framework. The .NET Framework
                                 provides support for numerous programming languages, including Microsoft
                                 and third-party languages.
Language                           Description

Microsoft Visual Basic .NET        Visual Basic .NET provides substantial language innovations over previous versions
                                   of Visual Basic. Visual Basic .NET supports inheritance, constructors,
                                   polymorphism, overloading, structured exceptions, stricter type checking, free
                                   threading, and many other features. With this release, Visual Basic Scripting Edition
                                   provides full Visual Basic functionality.
Microsoft Visual C#™               C# was designed for the .NET Platform and is the first modern component-oriented
                                   language in the C and C++ family. It can be embedded in ASP .NET pages. Some of
                                   the key features of this language include classes, interfaces, delegates, boxing and
                                   unboxing, namespaces, properties, indexers, events, operator overloading,
                                   versioning, attributes, unsafe code, and XML documentation generation. No header
                                   or Interface Definition Language (IDL) files are needed.
Managed Extensions C++             The Visual C++ upgrade is a managed, minimal extension to the C++ language. This
                                   extension provides access to the .NET Framework that includes garbage collection,
                                   single-implementation inheritance, and multiple-interface inheritance. This upgrade
                                   also eliminates the need to write plumbing code for components. It offers low-level
                                   access where useful.
Microsoft JScript® .NET            JScript .NET has been rewritten to be fully .NET compatible. It includes support for
                                   classes, inheritance, types, and compilation. It provides improved performance and
                                   productivity features. JScript .NET is also integrated with Visual Studio .NET. You
                                   can use of any .NET Framework class in JScript .NET.
Third-party languages              Various third-party languages are supporting the .NET Platform. These languages
                                   include APL, COBOL, Pascal, Eiffel, Haskell, ML, Oberon, Perl, Python, Scheme,
                                   and SmallTalk.
                                                              Module 1: Overview of the Microsoft .NET Platform   9



u What Are the .NET Framework Components?
Topic Objective
To provide an overview of
the topics covered in this
lesson.                                  n   The .NET Framework Components
Lead-in                                  n   Common Language Runtime
In this lesson, you will learn
about the different                      n   .NET Framework Class Library
components that make up
the .NET Framework.                      n   ADO .NET: Data and XML
                                         n   ASP .NET: Web Forms and Services
                                         n   User Interface




                                 In this lesson, you will learn about the Microsoft .NET Framework components.
                                 The .NET Framework is a set of technologies that are an integral part of the
                                 .NET Platform. The .NET Framework provides the basic building blocks to
                                 develop Web applications and Web Services by using ASP .NET.
10        Module 1: Overview of the Microsoft .NET Platform



The .NET Framework Components
Topic Objective
To provide an overview of
the .NET Framework
components.
Lead-in                                             ASP .NET: Web             User
Visual Basic .NET uses                             Forms & Services         Interface
these components that are
provided by the .NET                                          ADO .NET: Data & XML
Framework.
                                                      .NET Framework Class Library

                                                       Common Language Runtime




                             The components of the .NET Framework are as follows:
                             n   Common language runtime
                             n   .NET Framework Class Library
                             n   ADO .NET: data and XML
                             n   ASP .NET: Web Forms and Services
                             n   User interface
                                                          Module 1: Overview of the Microsoft .NET Platform   11



Common Language Runtime
Topic Objective
To highlight some of the key                         Base Class Library Support
components of the common
language runtime.
                                             Thread Support                   COM Marshaler
Lead-in
This topic will give you an
overview of the various                       Type Checker                  Exception Manager
components of the common
language runtime. Each                       Security Engine                   Debug Engine
component will be briefly
described. As a Visual Basic
developer, you will never                MSIL to Native           Code                  Garbage
physically see these pieces.              Compilers              Manager               Collection
But discussing them gives
you a better understanding
of the richness of the                                        Class Loader
runtime.




                                The Common Language Runtime simplifies application development, provides
Delivery Tip                    a robust and secure execution environment, supports multiple languages,
Many of these issues are
directly beneficial to Visual
                                simplifies application deployment and management, and provides a managed
Basic .NET developers and       environment.
will be highlighted
throughout the course.          What Is a Managed Environment?
                                A managed environment is one in which the environment provides common
                                services automatically. Examples of the types of services a managed
                                environment provides are garbage collection and security.
12   Module 1: Overview of the Microsoft .NET Platform


                          Common Language Runtime Components
                          The Common Language Runtime features are described in the following table.
     Component                       Description

     Class loader                    Loads the implementation of a loadable type into memory and prepares it for
                                     execution.
     Microsoft intermediate          Converts MSIL to native code (just-in-time).
     language (MSIL) to native
     compiler
     Code manager                    Manages code execution.
     Garbage collection              Provides automatic lifetime management of all of your objects. This is a
                                     multiprocessor, scalable garbage collector.
     Security engine                 Provides evidence-based security based on the origin of the code as well as
                                     the user.
     Debug engine                    Allows you to debug your application and trace the execution of code.
     Type checker                    Will not allow unsafe casts or uninitialized variables. IL can be verified to
                                     guarantee type safety.
     Exception manager               Provides structured exception handling, which is integrated with Windows
                                     Structured Exception Handling (SEH). Error reporting has been improved.
     Thread support                  Provides classes and interfaces that enable multithreaded programming.
     COM marshaler                   Provides marshaling to and from COM.
     .NET Framework Class            Integrates code with the runtime that supports the .NET Framework Class
     Library support                 Library. The .NET Framework Class Library is covered in the following
                                     lesson.
                                                                Module 1: Overview of the Microsoft .NET Platform   13



.NET Framework Class Library
Topic Objective
To provide an overview of
the .NET Framework Class
Library and the most
common namespace:
System.                                          System            System.Security        System.Runtime.
                                                                                          InteropServices
Lead-in
                                               System.Net            System.Text        System.Globalization
In this topic, you will learn
how the .NET Framework
                                            System.Reflection      System.Threading    System.Configuration
Class Library exposes
features of the runtime and
provides other high-level                      System.IO          System.Diagnostics    System.Collections
services.




                                The .NET Framework Class Library exposes features of the runtime and
Delivery Tip                    provides other high-level services that every programmer needs through an
The .NET Framework Class
Library provides many
                                object hierarchy. This object hierarchy is known as a namespace.
powerful new features for
Visual Basic .NET               System Namespaces
developers.
                                The System namespace contains fundamental classes and base classes that
For example, the
                                define commonly-used value and reference data types, events and event
Collections namespace           handlers, interfaces, attributes, and processing exceptions. Other classes provide
adds many new possibilities,    services supporting data type conversion, method parameter manipulation,
such as sorting, queues,        mathematics, remote and local program invocation, application environment
stacks, and auto-sizing         management, and supervision of managed and unmanaged applications.
arrays.
                                The System.Collections namespace provides sorted lists, hash tables, and other
The Threading system            ways to group data. The System.IO namespace provides file I/O, streams, and
class also creates new          so on. The System.NET namespace provides Transmission Control
possibilities to                Protocol/Internet Protocol (TCP/IP) and sockets support.
Visual Basic .NET
developers for creating true    For more information about namespaces, search for “namespaces” in the .NET
multithreaded applications.     Framework SDK documentation. Namespaces will also be covered in
                                Module 2, “Development Environment Features,” in Course 2373A,
A simple overview of            Programming with Microsoft Visual Basic .NET (Prerelease).
namespaces at this point
may be useful.
14        Module 1: Overview of the Microsoft .NET Platform



ADO .NET: Data and XML
Topic Objective
To explain the data and
XML support in the runtime.
Lead-in
The .NET Framework
provides a new set of ADO                      System.Data                        System.Xml
.NET classes to handle
data.                                                                        System.Xml.Schema
                                                                             System.Xml.Schema
                                         DataSet      DataRow

                                                                           System.Xml.Serialization
                                                                           System.Xml.Serialization
                                        DataTable     DataView




                                ADO .NET is the next generation of ActiveX® Data Object (ADO) technology.
Delivery Tip                    ADO .NET provides improved support for the disconnected programming
ADO .NET has been
created especially for
                                model. It also provides rich XML support.
Internet usage, as it uses
XML as its core technology.     System.Data Namespace
This means that developers
                                The System.Data namespace consists of classes that constitute the ADO .NET
no longer need to pass
Recordset objects around
                                object model. At a high level, the ADO .NET object model is divided into two
the system, potentially         layers: the connected layer and the disconnected layer.
limiting which clients they
                                The System.Data namespace includes the DataSet class, which represents
can service. It also improves
the disconnected
                                multiple tables and their relations. These data sets are completely self-contained
programming model seen in       data structures that can be populated from a variety of data sources. One data
previous versions of ADO.       source could be XML, another could be OLE DB, and a third data source could
                                be the direct adapter for SQL Server.
Point out that Visual Basic
developers’ knowledge of
ADO will greatly assist them
                                System.Xml Namespace
in moving to ADO .NET.          The System.Xml namespace provides support for XML. It includes an XML
                                parser and a writer, which are both W3C compliant. Transformations are
Check students’                 provided by the System.Xml.Xsl namespace and the implementation of XPath
understanding of basic          that allows data graph navigation in XML. The System.XML.Serialization
XML concepts.                   namespace provides the entire core infrastructure for Web Services, including
                                features such as moving back and forth between objects and an XML
                                representation.
                                                             Module 1: Overview of the Microsoft .NET Platform   15



ASP .NET: Web Forms and Services
Topic Objective
To introduce Web Forms
and Web Services.
Lead-in
                                                                  ASP .NET
The Internet is quickly                                            System.Web
evolving from today’s Web
sites that just deliver UI                        Services                UI
pages to browsers, to a next                       Description             HtmlControls
generation of programmable                         Discovery               WebControls
Web sites that link
organizations, applications,                       Protocols
services, and devices                             Caching                 Security
directly together. These
programmable Web sites                            Configuration           SessionState
are more than passively
accessed sites; they are
reusable, intelligent Web
Services.



                               ASP .NET is a programming framework that is built on the common language
                               runtime and that can be used on a server to build powerful Web applications.
                               ASP .NET Web Forms provide an easy and powerful way to build dynamic
                               Web user interfaces (UIs). ASP .NET Web Services provide the building blocks
                               for constructing distributed Web-based applications. Web Services are based on
                               open Internet standards, such as HTTP and XML. You can think of a Web
                               Service as a reusable component that is accessible across the Internet, rather
                               than being limited to Windows clients on a local area network.
                               The common language runtime provides built-in support for creating and
Delivery Tip                   exposing Web Services by using a programming abstraction that is consistent
Web development becomes
almost as simple as
                               and familiar to both Active Server Pages (ASP) and Visual Basic developers.
Windows-based application      The resulting model is both scalable and extensible. This model is based on
development with               open Internet standards (HTTP, XML, SOAP, and SDL) so that it can be
Visual Basic .NET.             accessed and interpreted from any client or Internet-enabled device. Some of
                               the more common ASP .NET classes are described in the following paragraphs.
Creating Web applications
can be accomplished in the
one IDE, whether they are
                               System.Web Namespace
Web page applications or       In the System.Web namespace, there are services such as caching, security,
Web Services.                  configuration, and others that are shared between Web Services and Web user
                               interface (UI).

                               System.Web.Services Namespace
                               The System.Web.Services namespace handles Web Service requirements such
                               as transportation protocols and service discovery.

                               System.Web.UI Namespace
                               The System.Web.UI namespace provides two classes of controls: HTML
                               controls and Web controls. The HTMLControls provide direct mapping of
                               HTML tags, such as <INPUT>. There are also WebControls that are richer and
                               allow you to structure controls with templates (for example, a grid control).
16         Module 1: Overview of the Microsoft .NET Platform



User Interface
Topic Objective
To explain how the .NET
Framework handles the user
interface for traditional
Windows applications.
Lead-in
In this lesson, you will learn                            System.Windows.Forms
how .NET handles the user
interface. The
System.Windows.Forms                                           System.Drawing
class provides the client-
side UI, and
System.Drawing provides
the next generation of GDI
services.




                                 Windows applications can provide more powerful user interfaces than ever by
                                                           s
                                 using the .NET Framework’ System.Windows.Forms and System.Drawing
                                 namespaces. The new .NET Windows Forms will look very familiar to
                                 Visual Basic developers.

                                 System.Windows.Forms Namespace
                                 You can use the System.Windows.Forms namespace classes to build the client
                                 UI. This class lets you implement the standard Windows UI in your .NET
                                 applications. Many functions that were previously only accessible by means of
                                 application programming interface (API) calls are now available as part of the
                                 forms themselves, making development much easier and more powerful.

                                 System.Drawing Namespace
                                 The System.Drawing namespace provides access to GDI+ basic graphics
                                 functionality. More advanced functionality is provided in the
                                 System.Drawing.Drawing2D, System.Drawing.Imaging, and
                                 System.Drawing.Text namespaces.
                                                         Module 1: Overview of the Microsoft .NET Platform   17



What Are the Visual Basic .NET Enhancements?
Topic Objective
To introduce some of the             n   Major Language Enhancements
major enhancements in
Visual Basic .NET.                       l   Enhanced object-oriented support
Lead-in
Visual Basic .NET provides
                                         l   Structured exception handling
major language                       n   Full Access to the .NET Framework
enhancements, full access
to the .NET Framework, and               l   New threading options
enhanced Web
development.                             l   Garbage collection
                                     n   Enhanced Web Development
                                         l   Create Web Forms as easily as Windows Forms
                                         l   Create Web Services quickly



                             Visual Basic .NET provides major language enhancements, full access to the
                             .NET Framework, and enhanced Web development.

Delivery Tip                 Major Language Enhancements
Discuss each point on the
                             In Visual Basic .NET, Visual Basic has undergone some significant changes to
slide and the advantages
each one gives developers.
                             allow Visual Basic developers to create powerful, robust, and scalable
                             enterprise applications.
                             n   Enhanced object-oriented support
                                 Allows Visual Basic .NET developers to use class inheritance, constructors,
                                 destructors, overloading, interfaces, and polymorphism. This gives
                                 Visual Basic .NET as much object-oriented power as any other .NET
                                 language, such as C# or Visual C++ with managed extensions.
                             n   Structured exception handling
                                 Simplifies exception handling, and allows you to use powerful features such
                                 as nested exceptions. This greatly improves the previous Visual Basic error
                                 handler.
18   Module 1: Overview of the Microsoft .NET Platform


                        Full Access to the .NET Framework
                        Visual Basic .NET developers have full access to the .NET Framework,
                        including the entire .NET Framework Class Library.
                        n   New threading options
                            Allow you to create applications that use multithreaded capabilities. For the
                            first time, Visual Basic developers will be able to create applications that are
                            capable of rivaling Visual C++–  based applications in this area.
                        n   Garbage collection
                            Ensures that applications created in Visual Basic .NET do not hold on to
                            unreferenced memory. This background process addresses memory-related
                            issues such as memory leaks and circular references that existed in previous
                            versions of Visual Basic and other languages.

                        Enhanced Web Development
                        Visual Basic .NET enables developers to quickly create powerful Web
                        applications.
                        n   Create Web Forms easily
                            You can do this as easily as Windows Forms by using the familiar technique
                            of writing code behind the event of a control. No longer do developers need
                            to use one integrated development environment (IDE) for Web page
                            development (such as Microsoft Visual InterDev® ) and another for
                            component development. All aspects of a Web application are now simply
                            created in a single environment in a way that will be easy for Visual Basic
                            developers to understand.
                        n   Create Web Services quickly
                            You can do this quickly in a fashion similar to creating components in
                            previous versions of Visual Basic. Web Services is a powerful technology
                                                                                        s
                            that allows you to access your components (or other people’ components)
                            across the Internet by means of HTTP. Any Visual Basic developer who has
                            created components will easily make the transition to Web Services.
                                                        Module 1: Overview of the Microsoft .NET Platform   19



Review
Topic Objective
To reinforce module
objectives by reviewing key
points.                               n   What Is the Microsoft .NET Platform?
Lead-in                               n   What Is the .NET Framework?
The review questions cover
some of the key concepts              n   What Are the .NET Framework Components?
taught in the module.
                                      n   What Are the Visual Basic .NET Enhancements?




                              1. What is the .NET Platform?
                                 The .NET Platform is a set of technologies designed to transform the
                                 Internet into a full-scale distributed computing platform. It provides
                                 new ways to build applications from collections of Web Services. The
                                 .NET Platform fully supports the existing Internet infrastructure
                                 (HTTP, XML, SOAP).



                              2. What are the core technologies in the .NET Platform?
                                 .NET Framework, .NET Enterprise Servers, .NET Building Block
                                 services, Visual Studio .NET, and Windows.



                              3. List the components of the .NET Framework.
                                 Common language runtime, .NET Framework Class Library, data and
                                 XML, Web Services and Forms, and Windows Forms.



                              4. What is the purpose of common language runtime?
                                 It provides an environment in which you can execute code.



                              5. What is the purpose of common language specification?
                                 It defines a set of features that all .NET-compatible languages should
                                 support.
20   Module 1: Overview of the Microsoft .NET Platform


                        6. What is a Web Service?
                            A Web Service is a programmable Web component that can be shared
                            between applications on the Internet or an intranet.



                        7. What is a managed environment?
                            A managed environment is one in which the environment provides
                            services, such as garbage collection, security, and other similar features.




                        THIS PAGE INTENTIONALLY LEFT BLANK

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:8
posted:2/26/2012
language:English
pages:52
Mohamed Sakr Mohamed Sakr
About