Topic: Visual Basic

Beginning Visual Basic 2005 (0764574019) cover image

Beginning Visual Basic 2005

Thearon Willis, Bryan Newsome
ISBN: 978-0-7645-7401-6
840 pages
November 2005
This title is out-of-print and not currently available for purchase from this site.

Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.

ChapterPageDetailsDatePrint Run
Default behavior of the DialogResult enumeration
The RTM version of Visual Studio 2005 changed the default behavior of the DialogResult enumeration.

In the book and in the downloaded code you will find examples such as DialogResult.OK. These dialog result enumerations must be fully qualified with the Windows.Forms namespace.

For example, DialogResult.OK should be written as Windows.Forms.DialogResult.OK. This applies to all DialogResult enumerations.
Database Explorer should be Server Explorer
Throughout the book, any references to Database Explorer should be Server Explorer.
14 Error in Text
Try It Out, Step 1, line 2 reads:
'click the _ button in the top-right...'

It should read:
'click the X button in the top-right...'
47 Error in Text
under heading "Integer Math Shorthand" --

"In the next Try It Out, you'll see how can perform"

should be:

"In the next Try It Out, you'll see how you can perform"
"In the next Try It Out, you'll see how to perform"
59 Error in Text
In "Try It Out" Item 2:

'Replace the string occurance

should be:

'Replace the string occurrence
60 Error in Code
example code for the "Displaying the Current Date" Try It Out: the last line to input:
MessageBox.Show(dteData, "Data Demo").

This fails to build if Option Strict is On. If Option Strict is Off, it builds and runs.

If you already have Visual Studio 2005 installed and running,if you try to run some of these tutorials with it on, you will get build errors.

Add: ".ToString" to the variable name, rendering...
MessageBox.Show(dteData.ToString, "Data Demo").
67 Typo
the first sentence in the last paragraph:
with base twp

should be:
with base two
76 Error in Text
Second paragraph third sentence --

"you change it in once place"

should be:

"you change it in one place"
76 & 77 Error in Code
Last line should be MessageBox.Show(dblArea.ToString, "Area").
120 Error in Text
How it Works, Second Paragraph

m (from "the 1 to 3 loop, which results in m being incremented.")
should be:
intLoop2 (becoming "the 1 to 3 loop, which results in intLoop2 being incremented.")
120 Error in Text
Second paragraph, second sentence under How It Works:

which results in m being incremented

should be:

which results in intLoop2 being incremented.
134 Error in Code
For intIndex as Integer ....
Code reads:

Should read:
140 Error in Code
Visual Basic 2005. 'Try it Out' at bottom of page lists:
If value >= 6 and value < 7 then
CurrentState =

Should read:
If value >= 6 and value < 7 then
CurrentState =
218 Step 8 Code Snippet
step 8, inserting code snippets.

There was a change between the last beta and the RTM So, when you go to "File System - Processing Drives, Folders, and Files" and then double click the "Read text from a file" different code will be inserted.

The following is the code inserted inside the "if statement"....

If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK
Dim fileContents As String
fileContents = My.Computer.FileSystem.ReadAllText("C:\Test.txt")
End If"
218 Error in Code
For step 9:

Modify the code as shown:

If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
'Save the file name
strFileName = OpenFileDialog1.FileName
'Read the contents of the file
Dim fileContents As String
fileContents = My.Computer.FileSystem.ReadAllText(strFileName
'Display the file contents in the TextBox
txtFile.Text = fileContents
End If
149 Error in Text
Try It Out, Item 1, Beginning Sentence:

Wrong type face for Name. It should be in the same type face as the sentence not in the type face of the code.
222 Error in File Name
Step 5:
the code that isinserted is: My.Computer.FileSystem.WriteAllText("C:\Test.txt","Text", True)
there is no Write New Text Files
should be:
a Write Text to a File.
235 Text Deletions
Printing using the PrintDocument class requires a lot of coding and knowledge of how actual printing works. Fortunately, the .NET Framework provides the My.Computer.Printers namespace, which simplifies your job as a developer.

This namespace wraps up all the complexities of printing and provides you with methods and properties that allow you to print a text document with ease and just a few lines of code. You can use the DefaultPrinter method of this namespace to print to the default printer, or you can use the Item property to specify the printer that you want to print to. Using either one, you can print a text document with as little as two lines of code, as shown in this code snippet:

With My.Computer.Printers.DefaultPrinter
End With

In the Print A Document section was left over from the original text for this book. This entire section along with the code had to be rewritten during CE-AR edits due to changes in the software.
236 Error in Text
In the code in Step 6:
should be prefixed with:
so the code reads:

243 Text Error
The Try It Out heading:

the ColorDialog Control
should be:
Working with the FolderBrowserDialog Control
422 Error in Text
second sentence of the step 3 in the "Try It Out":

"Right-click the Secure Login project in the Solution Explorer..."

should be read as:

"Right-click the Access Control project in the Solution Explorer..."
17 558 Error in Text
Step 7 DefaultClientScript Property:

You can switch to source view on the default.aspx page. That is at the bottom left of the design area. In between the start and end <head> tags put the following:

<meta content="text/VBScript" http-equiv="content-script-type" />
563 Error in Text
first bullet of step 6:
"Sert ID to rfvFirstName"
should be:
"Set ID to rfvFirstName"
566 Error in Text
4.3 :
Server Explorer

should be:
Solution Explorer
681 New method
The method ChannelServices.RegisterChannel(channel) is now obsolete. Although it will compile with only a warning and still work, you should use the new method signature ChannelServices.RegisterChannel(channel, False).
1007 Error in Figure
Figure 20-15:

IDC_CANCELORDER should be IDC_CANCEL to be consistent with the code download.
1007 Error in Figure
Figure 20-17:


should be: