Visual Basic 2005: A Developer's Notebook/Preface
|Visual Basic 2005: A Developer's Notebook|
TEST When Beta 1 of Visual Basic .NET hit the programming scene in 2001, the new tool challenged experienced Visual Basic developers to step up to an entirely new programming platform and a whole new way of writing code. Fortunately, four years later, it's clear that the rewards of moving to .NET make up for the steep learning curve developers experience when they try to do so. Developers who have made the jump have a powerful set of tools for building Windows and web applications—a set that other programming frameworks are hard-pressed to match.
Visual Basic 2005 and the platform it's built on, .NET 2.0, don't represent the same seismic change. Instead, Visual Basic 2005 and .NET 2.0 are the latest releases of what are now a mature language and platform. Microsoft architects have ironed out inconsistencies, corrected flaws, and added dozens of requested features, from VB 6's edit-and-continue debugger to new Windows and web controls for displaying data. Still, even the keenest developer could use a quick tour of Visual Basic 2005 and .NET 2.0 to come to terms with all the changes.
This book provides a series of hands-on labs that take you through the new features you'll find in Visual Basic 2005, the .NET Framework 2.0, and the Visual Studio 2005 development tool. Visual Basic 2005: A Developer's Notebook is perfect for developers who have worked with a previous version of .NET and need to quickly get up to speed with what's new. Best of all, you'll learn everything through concise, focused examples (all of which are just a short download away).
Who This Book Is For
This book is written for anyone who's asked the question "What's new in .NET 2.0?" or, even more importantly, "What does it let me do now that I couldn't do before?" As the latest in the Developer's Notebook series of books, this book answers these questions without requiring you to wade through pages of remedial VB lessons or .NET theory.
The most important requirement for this book is a solid familiarity with VB .NET 1.0 or 1.1, and experience building .NET applications. Visual Basic 2005: A Developer's Notebook covers very little of the material that an experienced VB .NET 1.1 programmer already knows. Instead, this book aims to help you build on your current knowledge, rather than waste your time covering old material. If you're a VB programmer who hasn't made the jump to .NET yet, you'll find the labs in this book interesting, but you'll need to supplement your .NET knowledge with another book first. Try one of the many great introductions, such as Jesse Liberty's Programming Visual Basic .NET (O'Reilly) or my own The Book of VB .NET (No Starch Press).
What You Need to Use This Book
To make the best use of this book, you'll need the following ingredients:
- Windows 2000 Professional, Windows XP, or Windows Server 2003.
- Visual Studio 2005. Alternatively, you can use a scaled-down Visual Studio version, but you won't be able to complete all the labs. For example, Visual Basic 2005 Express Edition allows you to build Windows applications, console applications, and DLL components (but not web applications), and Visual Web Developer 2005 Express Edition allows you to build only web applications.
- In addition, if you want to run the database examples in Chapter 5 without any changes, you'll need SQL Server 7.0 or later with the sample Northwind database. SQL Server Express will also work fine.
Because Visual Basic 2005 is currently in a beta cycle, it's inevitable that there will be some changes to the product after this book is printed. (In rare cases, entire features have disappeared from one build to the next!) As a result, it's possible that some recipes may not work as written. Usually, the difference is simply syntactic, such as a minor renaming of a property, constant, or method, or a reshuffling of a class from one namespace to another. Occasionally, a feature changes more dramatically, and significant code revisions are needed. To help manage the confusion, refer to http://www.oreilly.com/catalog/vbadn to download the latest sample code, which is updated regularly to keep in step with newer builds. As an early adopter, you already know that working with beta versions is awkward, frustrating, and more than a little exciting. But all in all, it's a small price to pay for getting an advance seat to see the changes to Visual Basic and the .NET platform!
About This Book
This book is divided into six chapters. Each chapter tackles a particular category of enhancements in the VB 2005 language and the .NET 2.0 Framework:
- Chapter 1, Visual Studio
- Visual Studio sports a host of embellishments, including enhanced IntelliSense and a new code snippets feature that puts useful examples at your fingertips. But the star of the show is undoubtedly the return of the long-missed edit-and-continue debugging engine.
- Chapter 2, The Visual Basic Language
- The VB 2005 language has some new keywords, some of which duplicate features found in C# (e.g., operator overloading), and others that leverage completely new .NET Framework features (e.g., generics). Learn about them all in this chapter.
- Chapter 3, Windows Applications
- The Windows Forms toolkit hasn't changed much, but a handful of entirely new controls provide modern menus and toolbars, masked text editing, web page display, and, finally, a decent data grid.
- Chapter 4, Web Applications
- ASP.NET boasts the most improvements of any part of the .NET Framework. In this chapter, you'll get an overview of many new features, including codeless data-binding, site navigation, and new solutions for personalization, all of which aim to dramatically reduce the amount of code you need to write.
- Chapter 5, Files, Databases, and XML
- In this chapter, you'll see what's new when dealing with data. This includes streamlined file access classes, a few new ADO.NET frills, and a better way to work with XML.
- Chapter 6, .NET 2.0 Platform Services
- The last chapter wraps up with a slew of miscellaneous topics that demonstrate new .NET Framework features. These features include support for FTP, access to the Windows user security system, and a new way to deploy applications with the ClickOnce technology.
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).
- Indicates new terms, URLs, email addresses, filenames, file extensions, pathnames, directories, usernames and passwords, and Unix utilities.
- Constant width
- Indicates commands, options, switches, variables, attributes, keys, functions, types, classes, namespaces, methods, modules, properties, parameters, values, objects, events, event handlers, XML tags, HTML tags, macros, the contents of files, and the output from commands.
- Constant width bold
- Used to highlight key portions of code.
This icon signifies a tip, suggestion, or general note.
This icon indicates a warning or caution.
This icon indicates a Developer's Note.
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: A Developer's Notebook, by Matthew MacDonald. Copyright 2005 O'Reilly Media, Inc., 0-596-00726-4."
If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at email@example.com.
Safari offers a solution that's better than e-books. It's a virtual library that lets you easily search thousands of top technology 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.
How to Contact Us
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:
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:
This book couldn't have been written without the help of the first rate team at O'Reilly, who invented this unique series and are always experimenting with new ideas. I'm deeply grateful to John Osborn for bringing me into this project and giving it (occasional) focus through a difficult beta cycle, and the excellent technical reviewers who reviewed it, including Jesse Liberty, Steve Saunders, and Dianne Siebold. I'm especially grateful to Erick Ellis at Microsoft and the Windows Forms team, who've been absolutely stellar in getting quick answers to my .NET questions. Thanks also to Jay Roxe and Jay Schmelzer of the Visual Basic team for their help in resolving last-minute problems. I also owe the usual thanks to my coterie, including Nora, Paul, Razia, Hamid, and my wife Faria.