Copyright 2003 by Karl Moore
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher.
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name , we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.
Technical Reviewer: Franky Wong, Stjepan Pejic
Editorial Board: Dan Appleman, Craig Berry, Gary Cornell, Tony Davis, Steven Rycroft, Julian Skinner, Martin Streicher, Jim Sumser, Karen Watterson, Gavin Wright, John Zukowski
Assistant Publisher: Grace Wong
Project Manager: Nate McFadden
Copy Editor: Tom Gillen of Gillen Editorial, Inc.
Production Manager: Kari Brooks
Proofreader: Lori Bring
Compositor: Diana Van Winkle, vwdesign.com
Indexer: Valerie Perry
Cover Designer: Kurt Krames
Manufacturing Manager: Tom Debolski
Distributed to the book trade in the United States by Springer-Verlag New York, Inc., 175 Fifth Avenue, New York, NY, 10010 and outside the United States by Springer-Verlag GmbH & Co. KG, Tiergartenstr. 17, 69112 Heidelberg, Germany.
In the United States: phone 1-800-SPRINGER, email <firstname.lastname@example.org>, or visit http://www.springer-ny.com. Outside the United States: fax +49 6221 345229, email <email@example.com>, or visit http://www.springer.de.
For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, CA 94710. Phone 510-549-5930, fax 510-549-5939, email < info @apress.com>, or visit http://www.apress.com.
The information in this book is distributed on an as is basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work.
The source code for this book is available to readers at http://www.apress.com in the Downloads section. You will need to answer questions pertaining to this book in order to successfully download the code.
Dedicated to the cream in my coffee.
About the Author
KARL MOORE lives in Yorkshire, England. He is author of Karl Moore s Visual Basic .NET: The Tutorials , and he runs his own international consultancy group , White Cliff Computing, Ltd. Karl is regularly featured at industry conferences and in leading development magazines, plus is a frequent voice on BBC radio.
You can visit his official Web site at www.karlmoore.com.
I had intended to write this book without any external influence. It was just me, my laptop and the green fields of England, from where I merrily tapped out each new secret as and when it was discovered .
I was, of course, being entirely romantic. The process of writing a book may begin as a solitary endeavor but undoubtedly ends up a group effort to get only the best of the best into your hands. And it s that group to which this simple page is pledged.
As ever, the usual yet sincere thanks are extended to the Apress directors ” Dan, Gary and Karen ”for their continued support. Especially Dan, always ready to use a little midnight wit to simmer me down in moments of heat.
Big thanks are also extended to project manager Nate for his coordination skills, and for whom the phrase It s pressure that turns stone into diamond appears to have been coined. And what would a book of mine be without the mandatory appreciation of editor Tom Gillen (a.k.a., Mr. Tom), the only man to blatantly criticize my writing and get away with it. Almost.
Credit is also given to Franky and Stjepan, who both stepped in at short notice as technical reviewers. I have never had the pleasure of working with such thorough individuals. Franky, your cross-referencing skills are amazing.
Plus, the rest of the Apress gang: Kari and Grace, for their work in getting this book into production; Valerie, for having to go through the indexing process; Beth, for her marketing prowess.
Then, we have the people on my side of the Atlantic. Deep thanks go to my parents, David and Tricia, for being the eternal mountains of support they are. To my famous sister, Jo-Anne, for cheering me up when the road looked tough. To my friends ”Mark, Katrina, Julie, Sinead, Jenny, and Alan ”for showing me how to dance to Night Fever. And to everyone at White Cliff, who continued working, even when I wasn t.
You know, Gonzo says that strangers are just friends you haven t yet met. And so, it is to you, future friend, that I provide this final acknowledgement . Thank you for reading and making this group dream possible.
I am neither especially clever nor especially gifted. I am only very, very curious
Have you noticed that the majority of .NET books seem intent on hiding you from real-world code? You can buy a 1,500-page draft excluder, study it exclusively for a month, and still be none the wiser as to how you can put together even the most basic of programs.
Truth is, those authors don t have much of a clue.
I mean, they went to the conference. They figured out how it worked in theory. But when it comes to showdown at the Code Coral, guess who stole the mule and left for Kansas?
This book isn t like that. Okay, it s not quite petite, but, then again, neither am I. It does, however, hold a vast amount of knowledge ”reams of useful code snippets and .NET programming tips that I have personally discovered and developed over the past three years .
Let s clarify here. These aren t updated Visual Basic 6 code scraps : everything within these pages has been created and tested for VB .NET and ASP.NET. And it s all super useful: I don t even want to tell you just how many chunks of code I ve written and scrapped during the production of this book.
Only the best survived. And you re holding them all.
Within these pages, you ll learn how to create exciting new XP-style interfaces. You ll figure out how to code ultra -thin Windows applications that automatically update via the Web. You ll learn dozens of hush-hush ASP.NET secrets, plus find out how you can steal Microsoft code and save hours of development time. You ll discover how to push your DataGrid to the max in Windows applications and on the Web. You ll figure out how to add powerful Google, Amazon, and TerraServer searches to your applications.
You ll uncover the truth behind creating fast programs that run on anything from PDAs to mobile phones to microwaves . You ll be exposed to a hidden .NET language. You ll be told why you need to know at least some C#, then given a cheat course on the basics.
Whether you re a hardened pro or a .NET newbie, this book is the bible you ll want to keep on your desk 24/7. And I am personally honored to have written it for you.
Thanks for learning with me.
How To Use This Book
This book has two core uses. First, there s the Coke coaster mode. That s where you essentially use it as a reference book: a .NET bible, if you will. Just stick it next to your computer and use it to protect your shiny new desk from stains. It ll start looking tatty after a few months, but at least it s nearby should you ever wish to do anything semi-interesting with .NET.
Second, and rather more fun, you could just read it all, back to front. Or front to back, depending on your preferences. If you re new to .NET (especially if you re coming from Visual Basic 6), you ll want to start at the Welcome to .NET! chapter. This will give you an overview of what this whole .NET lark is about. It also walks you through creating a basic Windows application and simple ASP.NET Web site, plus looks at some of the core language changes.
If you ve already used VB .NET or ASP.NET for a while, you re probably raring to get going with all the professional tips and techniques. Well, simply skip straight to the chapter you require, from Creating Great Windows Applications to Unveiled: The Hidden .NET Language . The full contents list at the beginning of this book will really assist in locating the sections most useful to you.
Also, in case you don t relish the thought of retyping the many code snippets presented in this book, you can download the full source online from www.apress.com ” alongside any fresh code snippets I added after we went to publication. Make sure you keep this book nearby however, as you ll be asked a couple of authentication questions first.
That s all: enjoy the book and happy VB ing!
Karl Moore, July 2003