Preface

Who This Book Is For

Visual Basic 2005 Jumpstart is written for VB 6 programmers who have yet to move to Visual Basic 2005, the latest release of Microsoft Visual Basic, one of the world’s most popular programming languages. With VB 2005, Microsoft has given VB 6 developers a host of reasons to upgrade now, including the return of VB 6 features omitted from earlier versions of VB.NET.

My aim is to provide you with a starting point—a jumpstart—that demonstrates how easy it is to become productive with the new language when it’s paired with the Visual Studio 2005 development environment.

To get the most out of this book, you’ll need a copy of Visual Studio 2005 that supports Visual Basic (see “What You Need to Use This Book”). I encourage you to work your way through the sample applications, especially those in Chapters 1, Chapters 4, and Chapters 5, as they are purposefully small and designed to show off the best of the new features in VB 2005. You’ll be surprised at how easily and quickly you can build a relatively sophisticated Windows or web application. The complete source code for the book (along with any errata) is available on the O’Reilly web page for this book, http://www.oreilly.com/catalog/vbjumpstart/.

How This Book Is Organized

Visual Basic 2005 Jumpstart consists of six chapters, each of which focuses on a particular aspect of the VB 2005 language or a type of project that VB 6 programmers are likely to encounter in making the move to the new tool.

Chapter 1, Introducing Visual Basic 2005

You’ll use VB 2005 and Visual Studio 2005 to build a simple Windows application that any VB 6 programmer will recognize. Though the application is simple, building it illustrates a number of powerful features present in the VB 2005 language and the Visual Studio 2005 development tool. Among these are new Windows controls with Smart Tasks, new Windows application templates, restored support for edit-and-continue, improved IntelliSense and Code Editor facilities, the Data Source Configuration Wizard, and Application Settings.

Chapter 2, Programming with Visual Basic

you will be taken on a whirlwind tour of the VB 2005 language and its syntax, and you’ll see how it compares with that of VB 6. If you are a VB 6 programmer, you’ll be happy to learn that much of what you already know is still supported (or enhanced) in VB 2005. You’ll also be introduced to the My namespace, which vastly expands the trove of functions available to Visual Basic programmers and provides easier access to the rich functionality of the .NET Framework Class Library.

Chapter 3, Putting Object-Oriented Programming to Work

You will be introduced to the support for object-oriented programming (OOP) available in VB 2005 and will learn why it matters. A principal reason for using OOP features in VB 2005 is the support they provide for reusing, customizing, and controlling the use others make of your code, and you’ll learn about a variety of techniques for accomplishing these tasks. You’ll also learn about the VB 2005 Class Designer, how to extend an existing class by inheriting from it, generic classes, Partial classes, and advanced OOP concepts such as abstract classes and methods, interfaces, attributes, and access modifiers.

Chapter 4, Developing a Windows Application

You will build a Windows application that demonstrates the ease with which Visual Studio 2005 and VB 2005 can be used to create professional Windows applications. You will also learn how to consume web services and how data can be persisted in a SQL database, and you will see how ClickOnce makes deployment and updating of smart clients easy and effortless.

Chapter 5, Building Web Applications

You will build a simple e-commerce web application using new controls in ASP.NET 2.0 that let you build powerful applications without writing much VB 2005 code at all. You will see how to use a Master Page to maintain a consistent look and feel for the pages of your site. You will also see how information about users could be persisted using the new Profile service. Last but not least, you will learn how easy it is to implement security in your web applications using new ASP.NET 2.0 security controls with the Membership class that powers them.

Chapter 6, Moving from VB 6 to VB 2005

You will learn about the various factors that you need to consider when deciding whether to upgrade an exisitng application. Upgrading from VB 6 to VB 2005 requires careful review of the application as well as analysis of the various benefits that a migration will bring you. You will also learn how you can continue to use your legacy COM components in VB 2005 and how the new RegFree COM feature in VB 2005 shields you from the notorious DLL hell problem. Finally, the chapter ends with a demonstration of the Visual Basic 6.0 Code Advisor and the Upgrade Wizard, which aim to ease the upgrade of your existing VB 6 applications to VB 2005, should you decide to go that route.

What You Need to Use This Book

To try out the many hands-on projects and code samples in this book, you’ll need to install any edition of Visual Studio 2005 on a computer running Windows. You can also use a combination of the new Visual Studio Express Editions. To work your way through all of the examples, you’ll need to install Visual Basic 2005 Express Edition, Visual Web Developer 2005 Express Edition, and SQL Server 2005 Express Edition, all of which are available on the MSDN web site.

Conventions Used in This Book

The following typographical conventions are used in this book:

Plain text

Indicates menu titles, menu options, menu buttons, and keyboard accelerators (such as Alt and Ctrl).

Italic

Indicates new terms, URLs, email addresses, filenames, file extensions, pathnames, directories, and Unix utilities.

Constant width

Indicates commands, options, switches, variables, attributes, keys, functions, types, controls, classes, namespaces, methods, modules, properties, parameters, values, objects, events, event handlers, XML tags, HTML tags, macros, the contents of files, or the output from commands.

Constant width bold

Shows commands or other text that should be typed literally by the user. Bold is also used in code samples to highlight lines of code that are discussed in the text.

Constant width italic

Shows text that should be replaced with user-supplied values.

Tip

This icon signifies a tip, suggestion, or general note.

Warning

This icon indicates a warning or caution.

Using Code Examples

This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Visual Basic 2005 Jumpstart, by Wei-Meng Lee. Copyright 2005 O’Reilly Media, Inc., 0-596-10071-X.”

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at .

Safari Enabled

image with no caption

When you see a Safari® Enabled icon on the cover of your favorite technology book, that means the book is available online through the O’Reilly Network Safari Bookshelf.

Safari offers a solution that’s better than e-books. It’s a virtual library that lets you easily search thousands of top tech books, cut and paste code samples, download chapters, and find quick answers when you need the most accurate, current information. Try it for free at http://safari.oreilly.com.

I’d Like to Hear from You

Please send comments, suggestions, and errata to . You can also visit my web site at: http://www.developerlearningsolutions.com for a list of articles that I have written on .NET. Check out the Code Library section to download sample code for topics on .NET, VB 2005, ASP.NET 2.0, and the .NET Compact Framework.

Comments and Questions

Please address comments and questions concerning this book to the publisher:

O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
(800) 998-9938 (in the United States or Canada)
(707) 829-0515 (international or local)
(707) 829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at:

http://www.oreilly.com/catalog/vbjumpstart/

To comment or ask technical questions about this book, send email to:

For more information about our books, conferences, Resource Centers, and the O’Reilly Network, see our web site at:

http://www.oreilly.com

Acknowledgments

I am very grateful to my editor, John Osborn, for giving me this opportunity to write a book on VB 2005. His patience and attention to detail have definitely made this book a better read. John has painstakingly read and reread every single word I have written and has always challenged me to rethink what I have written, and for this I am much honored to work with John. A big thank you, John!

Special thanks are also due to Jay Roxe, Product Manager of Visual Basic at Microsoft, for his support and review of this book. Jay has played an instrumental role in shaping the outline of this book and provided many useful suggestions for improving its content. Thanks for the hard work, Jay!

I also wish to express my gratitude to the reviewers for their comments and numerous suggestions. They include Robert Green, Jeff Barr, Paul Yuknewicz, and Joseph Binder.

As always, it has been a pleasure working with the O’Reilly team. A big thank you to the unsung heroes behind the scenes that made this book possible. Thanks!

Get Visual Basic 2005 Jumpstart now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.