Skip to main content

Beginning Visual Basic 2005

Thearon Willis, Bryan Newsome

ISBN: 978-0-764-57401-6

Nov 2005

840 pages

Select type: Paperback

Product not available for purchase

Description

  • After a brief introduction to Visual Studio 2005 and the .Net Framework, the expert authors introduce readers to the fundamentals of the Visual Basic 2005 language
  • End-of-chapter exercises help readers to quickly learn to build rich and professional-looking applications for Microsoft Windows, intranets and the Internet, and mobile devices
  • Offers thorough coverage of the new Visual Studio 2005 tools and features
  • Covers object-oriented programming, creating custom controls, working with databases, creating menus, and working with graphics
  • Addresses building class libraries, Web services and .NET remoting, and deploying applications
Acknowledgments.

Introduction.

Chapter 1: Welcome to Visual Basic 2005.

Chapter 2: The Microsoft .NET Framework.

Chapter 3: Writing Software.

Chapter 4: Controlling the Flow.

Chapter 5: Working with Data Structures.

Chapter 6: Building Windows Applications.

Chapter 7: Displaying Dialog Boxes.

Chapter 8: Creating Menus.

Chapter 9: Debugging and Error Handling.

Chapter 10: Building Objects.

Chapter 11: Advanced Object-Oriented Techniques.

Chapter 12: Building Class Libraries.

Chapter 13: Creating Your Own Custom Controls.

Chapter 14: Programming Custom Graphics.

Chapter 15: Accessing Databases.

Chapter 16: Database Programming with SQL Server and ADO.NET.

Chapter 17: Web Forms.

Chapter 18: Forms Authentication.

Chapter 19: Visual Basic 2005 and XML.

Chapter 20: Web Services and .NET Remoting.

Chapter 21: Deploying Your Application.

Chapter 22: Building Mobile Applications.

Appendix A: Where To Now?

Appendix B: Implementing the Microsoft Solutions Framework.

Appendix C: An Introduction to Security.

Appendix D: Solutions.

Index.

Download the code files
Code downloads for this title are available here.
Download
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.
3/16/06

Database Explorer should be Server Explorer
Throughout the book, any references to Database Explorer should be Server Explorer.
1/9/06

14Error 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...'
06/05/2006

47Error 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
OR
In the next Try It Out, you'll see how to perform
01/28/2008

59Error in Text
In Try It Out Item 2:

'Replace the string occurance

should be:

'Replace the string occurrence
01/25/2008

60Error 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.

NOTE
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.

TO FIX
Add: .ToString to the variable name, rendering...
MessageBox.Show(dteData.ToString, Data Demo ).
03/30/07

67Typo
the first sentence in the last paragraph:
with base twp

should be:
with base two
01/08/07

76Error in Text
Second paragraph third sentence --

you change it in once place

should be:

you change it in one place
02/05/2008

76 & 77Error in Code
Last line should be MessageBox.Show(dblArea.ToString, Area ).
12/05/2007

120Error 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. )
07/03/07

120Error in Text
Second paragraph, second sentence under How It Works:

which results in m being incremented

should be:

which results in intLoop2 being incremented.
02/11/2008

134Error in Code
For intIndex as Integer ....
Code reads:
lstFriends.Items.Add(StrFriends(0))

Should read:
lstFriends.Items.Add(StrFriends(intIndex))
05/17/2006

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

Should read:
If value >= 6 and value < 7 then
CurrentState =
DayAction.GetingReadyForWork
03/31/2006

218Step 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
Then
Dim fileContents As String
fileContents = My.Computer.FileSystem.ReadAllText( C:\Test.txt )
End If
3/23/06

218Error 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
03/12/2008

149Error 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.
02/11/2008

222Error 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.
08/23/06

235Text 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
.WriteLine(txtFile.Text)
.Print()
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.
1/6/06

236Error in Text
In the code in Step 6:
DialogResult.OK
should be prefixed with:
Windows.Forms
so the code reads:

Windows.Forms.DialogResult.OK
06/05/2006

243Text Error
The Try It Out heading:

the ColorDialog Control
should be:
Working with the FolderBrowserDialog Control
1/05/06

422Error 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...
1/24/06

17558Error 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 />
05/18/2006

563Error in Text
first bullet of step 6:
Sert ID to rfvFirstName
should be:
Set ID to rfvFirstName
1/24/06

566Error in Text
4.3 :
Server Explorer

should be:
Solution Explorer
12/05/06

681New 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).
3/28/06

1007Error in Figure
Figure 20-15:

IDC_CANCELORDER should be IDC_CANCEL to be consistent with the code download.
1/28/2008

1007Error in Figure
Figure 20-17:

IDC_PRODCUCTNAME

should be:

IDC_PRODUCTNAME .
01/28/2008