Monday, August 23, 2010

A Programmer's Introduction to Visual Basic.Net













Contents
INTRODUCTION 1
1 WHY SHOULD YOU MOVE TO VISUAL BASIC.NET? 3
Visual Basic.NET: A New Framework....................................................3
The Common Language Runtime............................................................6
Managed Execution ................................................................................8
Microsoft Intermediate Language (MSIL) ........................................8
The Just-In-Time Compiler ................................................................9
Executing Code ..................................................................................9
Assemblies........................................................................................10
The Common Type System ..................................................................12
Classes ..............................................................................................13
Interfaces ..........................................................................................13
Value Types ......................................................................................14
Delegates ..........................................................................................14
The .NET Framework Class Library ....................................................14
Self-Describing Components ................................................................15
Cross-Language Interoperability ..........................................................16
The Catch..........................................................................................17
Security ..................................................................................................17
Code Access Security (CAS)............................................................18
Role-Based Security ........................................................................18
Summary................................................................................................18
2 YOUR FIRST VB.NET APPLICATION 21
The Start Page........................................................................................21
Creating a New Project..........................................................................23
Examining the IDE ..........................................................................25
Creating Your First VB.NET Application..............................................31
Windows Application Enhancements ....................................................36
Resizing Controls Automatically......................................................36
Anchoring Controls to the Form Edges ..........................................38
Easier Menus ....................................................................................41
Setting Tab Order ............................................................................42
Line and Shape Controls: You’re Outta Here ..................................44
Form Opacity....................................................................................45
Summary................................................................................................48
3 MAJOR VB.NET CHANGES 49
General Changes ....................................................................................49
Default Properties ............................................................................49
Subs and Functions Require Parentheses ........................................50
Changes to Boolean Operators ........................................................51
Declaration Changes ........................................................................52
Support for New Assignment Operators ..........................................52
ByVal Is Now the Default ................................................................53
Block-Level Scope ..........................................................................53
While...Wend Becomes While...End While ..................................54
Procedure Changes ..........................................................................54
Array Changes ..................................................................................57
Option Strict..................................................................................58
Data Type Changes ..........................................................................59
Structured Error Handling ................................................................62
Structures Replace UDTs ................................................................64
IDE Changes ....................................................................................66
New Items ..............................................................................................66
Constructors and Destructors ..........................................................66
Namespaces ......................................................................................67
Inheritance ........................................................................................69
Overloading ......................................................................................69
Free Threading..................................................................................70
Garbage Collection ..........................................................................72
Summary................................................................................................72
4 BUILDING CLASSES AND ASSEMBLIES WITH VB.NET 73
Creating Your First Class Library ..........................................................74
Adding a “Souped-Up” Class ..........................................................74
Creating Properties ..........................................................................75
Building a Test Client ......................................................................76
Read-only and Write-only Properties ..............................................79
Parameterized Properties ..................................................................79
Default Properties ............................................................................80
Constructors in Your Classes............................................................80
Classes Without Constructors ..........................................................81
Adding Methods to Classes..............................................................82
Adding Events ..................................................................................82
The “Final” Code ..................................................................................84
Compiling the Assembly........................................................................86
Reusing the Assembly in Other Applications ..................................87
How .NET Locates Assemblies........................................................88
Summary................................................................................................90
5 INHERITANCE WITH VB.NET 91
What Is Inheritance? ..............................................................................91
Interface Inheritance in VB6 ............................................................92
VB.NET’s Implementation Inheritance............................................93
A Quick Inheritance Example ..............................................................94
Shared Members ....................................................................................95
Inheritance Keywords ............................................................................96
Forcing or Preventing Inheritance ....................................................96
Overriding Properties and Methods ................................................97
Polymorphism........................................................................................99
Polymorphism with Inheritance ....................................................100
Polymorphism with Interfaces........................................................101
When to Use and When Not to Use Inheritance ................................102
Summary..............................................................................................103
6 DATABASE ACCESS WITH VB.NET AND ADO.NET 105
Accessing a Database from a Windows Application ..........................106
Using the DataAdapter Configuration Wizard ..............................107
ADO.NET............................................................................................122
About ADO.NET............................................................................122
DataSets ..........................................................................................122
Working with the ADO.NET Objects ............................................123
XML Integration ..................................................................................128
The XML Designer ........................................................................129
Summary..............................................................................................131
7 BUILDING WEB APPLICATIONS WITH VB.NET AND ASP.NET 133
Your First ASP.NET Application ........................................................134
How ASP.NET Works ..........................................................................137
Web Pages and Code ......................................................................138
Server Controls ....................................................................................138
Validation Controls ........................................................................142
Data Binding ........................................................................................149
Handling Re-entrant Pages ..................................................................151
Summary..............................................................................................152
8 BUILDING WEB SERVICES WITH VB.NET 153
Creating Your First Web Service ........................................................154
Testing the Web Service ................................................................155
Creating a Web Service Client ............................................................156
How Web Services Work ....................................................................162
And You Thought Disco Was Dead................................................163
Accessing Web Services ................................................................163
Summary..............................................................................................164
9 BUILDING WINDOWS SERVICES WITH VB.NET 165
Creating Your First Windows Services Project....................................166
Adding Installers to Your Service ..................................................168
Configuring Your Service ..............................................................169
Understanding Windows Services ......................................................170
Service Lifetime and Events ..........................................................171
Debugging Your Service ................................................................172
Summary..............................................................................................173
10 UPGRADING VB6 PROJECTS TO VB.NET 175
Upgrading Your First VB6 Application ..............................................175
The Visual Basic Upgrade Wizard ................................................176
Examining the Upgraded Forms and Code ....................................178
Modifications..................................................................................179
Differences in Form Code ..............................................................180
The Visual Basic Compatibility Library..............................................181
The Upgrade Process ..........................................................................182
Learn VB.NET................................................................................182
Pick a Small Project and Make Sure That It Works ......................182
Upgrade the Project and Examine the Upgrade Report ................183
Fix Any Outstanding Items in VB.NET ........................................183
Helping Your VB6 Applications Upgrade ..........................................183
Do Not Use Late Binding ..............................................................183
Specify Default Properties..............................................................184
Use Zero-Bound Arrays..................................................................184
Examine API Calls ........................................................................184
Form and Control Changes ............................................................185
Summary..............................................................................................185
A THE COMMON LANGUAGE SPECIFICATION 187
What Is the Common Language Specification? ..................................187
VB.NET Data Types and the CLS ......................................................188
INDEX 191

Download
Another Visual Basic Books

No comments:

Post a Comment

Related Posts with Thumbnails

Put Your Ads Here!