Introduction

About This Book

There are lots of different kinds of software. There are communications tools, graphics packages, Web page development tools, and Internet add-ins of seemingly endless variety. C# and C++ are good for all these kinds of applications. But my favorites are database applications. And of all of the languages sold by Microsoft, Visual FoxPro and Visual Basic .NET are the two most suitable for database application development.

Databases are simply collections of tables, each containing a single kind of record. By using software to relate records from various tables, you can build complex systems to deal with data for accounting, contact management, medical information, tax collection, law enforcement, space vehicle development, and anything else. Alan Greenspan attributes the increasing prosperity of the United States to computer software, and I don't think he's talking about software for drawing pictures. Databases are awesome.

Database development, as a profession, is about as good as it gets. I can't wait to get to my office every morning. Every new project offers a chance to extend my skills. Every day produces a new plateau of achievement. I can't recommend it enough to young people who are looking for a great job and the pay ain't bad.

Microsoft is the world's largest vendor of software development tools. Its flagship product, Visual Studio, supports four of Microsoft's languages: C++, C#, J#, and Visual Basic. Microsoft also sells Visual FoxPro, a language originally conceived solely for database application development. Visual FoxPro has its own IDE, is not a part of Visual Studio, and does not integrate natively with Visual Studio languages.

Visual Basic .NET is a complete rewrite of the Visual Basic language, with a well-thought-out architecture that is methodologically elegant and robust. It represents a huge step forward in Microsoft's strategy to provide a full range of tools for application development. Visual Basic .NET's architecture moves commands and functions out of the language and into objects, a trend that is bound to continue. I see the best of Delphi, FoxPro, Visual Basic 6, and even C++ in Visual Basic .NET.

This is not to say that Visual FoxPro applications are unsophisticated compared to those written in Visual Basic .NET. In fact, they're very similar. But Visual FoxPro is easier to learn. You can write your first working application in a few hours.

Microsoft spends huge amounts of money advertising Visual Studio. FoxPro, on the other hand, is practically invisible. I won't speculate on Microsoft's reasons for not advertising FoxPro. It is a spectacular product. It is easier to learn; it takes less time to develop comparable applications; and Visual FoxPro applications run faster than anything written in Visual Basic .NET. But if you don't have clients, it's not a job; it's a hobby.

Visual Basic .NET is the database application development tool of the future. Its architecture is elegant and extensible. It gives you dozens of controls and components, drawing features from Visio, integrated UML support, integrated SQL Server administration and query support, Crystal Reports designer, an HTML editor, and everything else you can imagine. With power comes complexity, but the feature list is impressive. And it has Microsoft's support, without which no product can survive.

Who Should Read This Book

Demand for database applications seems to have no limits. There's not a corporation on this planet that couldn't make double or triple its initial investment in a database application that allowed their employees to work more efficiently. In some cases, applications of this type pay for themselves in a month! The average company considers itself lucky if a particular machine pays for itself in two years, but a 200% annual rate of return is easy to achieve in the database world. So when you walk into the office of a potential client or employer, you're selling something that pays for itself faster than just about any other investment the company could make. That's a pretty good resume.

Database development is fun, the pay is great, and you get to be a hero. We even get more credit than we deserve. For some reason, if a guy comes over and fixes your toilet, he's just a plumber; but when your cousin Danny, a 14-year-old with a bad complexion, gets an Internet connection working again, they call him a computer genius. Doesn't make much sense to me, but take advantage of it. What we do is cool.

Database application development is an excellent career choice. Many young people get an undergraduate degree in one of the soft sciences, like Sociology, Anthropology, or Economics, only to find out that the only jobs they qualify for are trainee jobs. But not everyone wants to get a job in Engineering or Pharmacy. And computer science departments seem determined to teach skills that are not in high demand—compiler design and ray tracing graphics are important, but how many operating systems and graphics packages do we need?

I also recommend database development as a second career to professionals who have already achieved mastery of one set of skills, and are looking for something to integrate into their professional life and synthesize a new direction. I've known doctors, dentists, veterinarians, chemists, biologists, actors, teachers—a variety of people who had a decade or two of successes under their belt, but who were still hungry for a new adventure—and made the shift to database development. Databases go with everything.

If you think you missed the boat and lost your chance to prepare for a good career, you're dead wrong. I first saw FoxPro's predecessor, FoxBASE, in 1986, when I was 38 years old. That's when my database career started (unless you count a dozen years with COBOL, which I try to forget). So if you're 24 and think you're too old to start a career, don't make me laugh. (You might be too young, though. Sow those wild oats; then come see me when you're ready to get serious about your future.)

Go through this book and learn how the code works. Make the application work, understand what it's doing, and how it does it. When you're done, you'll have a real career—the kind others dream of.

You can travel all around this little planet, meet other programmers, share your successes, pass on your discoveries, and generally have a wonderful time with this career. The languages change every few years, so you won't be bored. And you'll never, ever master database programming, because it's endless. There's always something more to learn, some new challenge to solve, and solutions to be found for your colleagues who think something can't be done. You can push the limits as far as you want. Database development can become the foundation for a successful life.

How This Book Is Organized

This book begins with a review of the major differences between Visual FoxPro and Visual Basic .NET. It shows examples of object-oriented programming in both languages by demonstrating a class-based FoxPro example first, then providing the equivalent in Visual Basic .NET. Finally, it covers specific topics, allowing you to compare the two languages in much more detail. Go to www.samspublishing.com to download the code examples in this book.

What's Not Included

A number of topics are not included in this book. I was unable to include a detailed treatment of thin client development and the construction of installers, due to page count limitations. I excluded the treatment of the Visual FoxPro Toolkit for .NET written by Kamal Patel (www.KamalPatel.net) for the same reason that I excluded the VisualBasic Namespace; because, the whole point of using .NET is to discover its capabilities and use them, rather than depending on legacy features. I've left out remoting and reflection because they are advanced topics that are not required to build many basic database applications.

I didn't talk about third-party products such as RapTier and Visible Developer, both of which will save countless hours, because they build middle-tier code that you will and should know how to write yourself. You can always go out and buy this kind of tool once you understand what they do for you. Finally, I didn't mention Visual CE, a great tool for building Pocket PC applications, because FoxPro doesn't provide a mechanism for programming Windows CE.

With Visual Basic .NET, you can do things that you can't do with FoxPro. However, if you start at the beginning and work through the chapters, writing and testing the code as you go, by the time you finish the book you'll be able to build the same kind of database applications in Visual Basic that you've built in FoxPro. This should get you started on the rest of your career.

An Offer You Can't Refuse

To all readers wherever you live, I'll make you an offer you can't refuse: My email address is . If you have any problems with this book, or can't get something to work, or just need a little encouragement, send me an email. When I'm gone, my life will be measured by the number of people whose lives I've affected. So I'd consider it an honor to hear from you. And if you need assistance migrating to .NET, give me a call. My entire consulting practice is focused on migrating Visual FoxPro applications to .NET, and I'd be happy to share the experience with you.

Les Pinter

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.64.23