101 Samples for Visual Basic 2005

These 101 samples demonstrate many of the new features available with Visual Basic 2005 and the .NET Framework 2.0. Get the most recent code samples for Visual Basic on Code Gallery. Also available for download are 101 Visual Basic and C# Code Samples for Visual Basic .NET 2003.

101 Samples for Visual Basic 2005 Download all 101 Samples for Visual Basic 2005 


Base Class Libraries - Group 1 Samples

The Base Class Library Group 1 samples show how to use the classes in the namespaces System.Net, System.Text.RegularExpressions, System.Transaction, System.Console, and more. Samples include:

  • Changing ACL (Access Control Lists) on files
  • Console Enhancements including buffer control, simple animations and colors
  • Downloading files using FTP (File Transfer Protocol)
  • Network Programming including PING, UDP, and TCP network statistics
  • Using the new Stopwatch class to measure time
  • Compressing and decompressing files in the GZip format
  • Retrieving Drive Information
  • Using Generic Collections
  • Creating Regular Expressions to parse text

Download the Visual Basic version of the Base Class Library Group 1 samples.

Base Class Libraries - Group 2 Samples

The Base Class Library Group 2 samples show how to use the new classes and methods in the namespaces System.Net.Cache, System.Runtime.InteropServices, System.Net.Sockets.Socket, and more. Samples include:

  • Building a tracing infrastructure to track errors and application performance
  • Controlling cache policies with the new System.Net.Cache namespace
  • Creating a process viewer
  • Creating a Windows service manager
  • Using the data protection API
  • Encrypting and decrypting data
  • Using platform invoke to access legacy or unmanaged code from within managed code
  • Building in support for localization
  • Using the NGEN utility
  • Using the new SecureString class
  • Using new socket class methods
  • Using serial ports with the new Port class
  • Working with the file system
  • Working with threads to manage multiple tasks simultaneously
  • Building a simple web server with HTTPListener

Download the Visual Basic version of the Base Class Library Group 2 samples.

Data Access Samples

The Data Access samples show how to use the classes in the System.Data and related namespaces. In addition, how to use the new features of SQL Server 2005. Samples include:

  • Asynchronous Queries
  • Attaching a database with your application
  • Creating and using User Defined Types with SQL Server 2005
  • DataReader vs. DataSet comparision
  • DataSet and DataTable Enhancements
  • Performing Batch Updates and Data Paging
  • Performing Bulk Updates
  • Reading and Writing Images from a Database
  • Using Factory Classes
  • Using Managed Stored Procedures and User Defined Functions with SQL Server 2005
  • Using Multiple Active Result Sets with SQL Server 2005
  • Using Notifications with SQL Server 2005
  • Using the XML data type with SQL Server 2005
  • XPath and XSLT Transformations Enhancements

Download the Visual Basic version of the Data Access samples.

.NET Compact Framework Samples

The .NET Compact Framework samples show how to use the new functionality found in Windows Mobile 5.0. Samples include:

  • Creating a setup CAB
  • Creating a data-centric application
  • Creating a data-centric application (part 2)
  • Using the date/time picker feature in the month calendar
  • Document list
  • Embedded resources
  • Handling the screen orientation
  • Handling the hardware button screen orientation
  • Help and notifications
  • Registry sample
  • Creating a SQL CE result set
  • Using Microsoft Message Queue (MSMQ)
  • Web browser sample

Download the Visual Basic version of the .NET Compact Framework samples.

Tablet PC Samples

The Tablet PC samples show how to create ink-enabled applications that utilize the power handwritten input with Tablet and Ultra Mobile Personal Computers. Samples include:

  • Utilizing the back of pen erase feature
  • Creating a content enabled form
  • Working with drawing attributes
  • Enabling gestures
  • An ink-enabled text box
  • Creating power aware applications
  • Simple text recognition
  • Speech recognition

Download the Visual Basic version of the Tablet PC samples.

Visual Studio Tools for Office Samples

The Visual Studio Tools for Office (VSTO) samples show how to add functionality to Office applications like Word, Excel, InfoPath, and Outlook using the .NET Framework and C# or Visual Basic. Samples include:

  • Creating custom menus in Outlook
  • Creating smart tags in documents
  • Creating custom toolbars
  • Data islands and caching
  • Integrating Windows forms into Outlook
  • Using bookmarks in Word
  • Using managed controls in Excel
  • Using VBA and VSTO together
  • Working with charts in Excel
  • Working with contacts and tasks in Outlook
  • Working with InfoPath 2003
  • Working with named ranges in Excel
  • Working with the In Box
  • Working with XML in Excel
  • Working with XML in Word
  • Using the List object

Download the Visual Basic version of the Visual Studio Tools for Office samples.

Web Development Samples

The Web Development samples show how to use some of the new features of ASP.NET 2.0. Samples include:

  • Caching
  • Data Access
  • Data Controls
  • Master Pages
  • Membership
  • Menu Controls
  • Profiles
  • Security
  • TreeView
  • Portal development with Web Parts

Download the Visual Basic version of the Web Development samples.

Windows Forms Samples

The Windows Forms samples show how to use some of the new functionality available to developers building desktop applications. Samples include:

  • Asynchronous Tasks
  • Client Configuration
  • Creating Master/Detail Forms
  • Playing Sounds
  • Using BindingNavigator
  • Using BindingSource
  • Using ClickOnce
  • Using the DataGridView control
  • Using LayoutPanels
  • Using the MaskedTextBox control
  • Using the Menus, StatusStrips and ToolStrips controls
  • Using My Note: This sample is only available for Visual Basic
  • Using the SplitContainer control
  • Using the WebBrowser control

Download the Visual Basic version of the Windows Forms samples.