Visual Basic .NET Programming With Peter Aitken
Coriolis Group, 2002
629 pages, $49.99
Aimed at beginning and intermediate level programmers, this book provides a clear and thorough coverage of Microsoft's exciting new Visual Basic .NET development platform. It is written as a combination tutorial and reference, and provides lots of working code and hands-on examples. The included CD-ROM includes all of the book's source code, the Microsoft .NET Software Development Kit, and several useful programmer tools and utilities.
Note: The original publisher of this book, the Coriolis Group, is no longer in business. The book is now being distributed by Paraglyph Press.
Appendix A: Changes in Visual Basic .NET
Appendix B: The Upgrade Wizard
Appendix C: VB.NET Exceptions
Appendix D: Compiler Options
This is not a correction per se but adds some information that I neglected to include in this section of the chapter.
To close a form, use the Me.Close() method. This closes the current form. If this form is the application's only (or last open) form this statement also has the effect of terminating the application. To terminate the entire application regardless of how many forms are open, call Application.Exit().
The code for step 4, the second line should be as follows:
If Not IsNothing(theCaller) Then theCaller.Show()
You could also get the same result as follows:
If Not theCaller Is Nothing Then theCaller.Show()
In the listing the following line of code is wrong:
d = Day(Now)
Replace it with the following line:
d = DateTime.Now.Day
The first sentence on the page is incorrect - it should read "A read-only property is one whose value can be read, but not set, by a program."
The standard edition of Visual Basic.NET does not provide a project template for a Windows Control Library project. You can still create individual controls from a Windows Application project by selecting Add User Control from the Project menu.
The MDI application demo is missing two steps of the instructions. Between steps 4 and 5 add the following step.
Add an OpenFileDialog control and a SaveFileDialog control to the form.
Between steps 6 and 7 add the following:
Add a RichTextBox control to the form. Change its Name property to RTB1 and its Dock property to Fill.
In the binary file demonstration program, the following should be included as the second step for creating the program:
2. At the top of the form's code add the following statement:
The program in which this code runs must include the Imports System.IO statement.
Listing 19.1 does not include an Imports statement for the System.Data.SqlClient assembly, nor does it include declarations for the variables sqlCon, sqlAdapter, or ds. It is assumed that these are included in other parts of the program that contains the method in Listing 19.1, as was detailed in code snippets earlier in the chapter.
Page 502 - First Web Service project
In the instructions for creating a web service, it specifies to enter "Adder" in the Name box. This should be changed to specify that in the Location box you edit the default location so it reads "http://localhost/adder.
Also, the book specifies, at the bottom of page 502, that you must enter the namespace declaration into the code. The release version of Visual Studio does this automatically, so you do not have to. Note that the correct namespace is "http://tempuri.org/".
Before navigating to your page, as described at the top of page 504, be sure to save your project.