Introduction


Visual Studio 2005 includes a number of new controls in the Toolbox that you need to understand and learn to leverage if you expect to be able to create professional applications. Of course, the Toolbox is stuffed full of controls and wizard-launchers that folks new to Visual Studio are also going to have to learn. It's well beyond the scope of this book to detail them all, but there are a number of data management controls that I would like to discuss in this chapter. When used correctly, some of these "data" controls can save you a great deal of time when building your application, and they can also be used as foundations for your own custom controls. That is, you can use Visual Studio to create your own custom composite controls that inherit from the existing controls. This way you can add events and properties, and interrelate two or more controls into a single custom control.

As usual, the Visual Studio team has reinvented too many of these controls for my liking. Long-timers tell a story about new developers at Microsoft. One of the first tasks these "kids" take on is to write a new data grid control. As a result, Microsoft is hip-deep in data grids of every conceivable typeand some are virtually inconceivable. Apparently, the best of these is dubbed the new Visual Studio data grid control each time Microsoft ships a new version. This time, it's the DataGridView. I'll discuss this control to some extent and walk through some of its new features and issues. Yup, it has lots of shiny new knobs, lights, and switches, but how many times can Microsoft re-create the shovel?

Controls and how they're accepted by the developer and third-party community are critically important to Visual StudioBill Gates thought so, and so do I. The very first version of Visual Basic was held back by Bill (the other one) as the Microsoft development team did not include "extensibility." That is, he wanted Visual Basic programmers to be able to buy third-party controls to extend the power of Visual Basic applications they wrote. I think this was a critically important decision and made the difference in how quickly Visual Basic has been adopted over the last decade. Without these third-party grids, custom dialogs, and other controls Microsoft was unable or unwilling to create and support, Visual Basic developers would have been stuck with the functionally challenged controls that shipped with Visual Basic. This extensible architecture also unloaded the Microsoft Visual Basic team so they were not pressured to create and support a host of world-class controls. Given their limited manpower and budget, Microsoft knew that third-party developers could spend a lot more time and talent on control development than they could. The result was the birth of an entire industry of control vendors.

IMHO

Remember that Visual Studio is an application development platform and is designed to build a number of different types of application architectures. Yes, both the Windows Forms and ASP.NET architectures support use of Visual Studio Toolbox controls to populate your UI. However, these two architectures are radically different, so it's unreasonable to expect them to behave the same or support the same functionalityat any level. Any similarity is an accidental blessing.


To leverage Visual Studio's application architecture flexibility and extensibility, several third-party companies have built controls to use with Windows Forms and ASP.NET application architectures. Some of these controls are distributed as free samples (like the terrific Windows Forms Validator controls written by Bill Hollis[1] that are included on the DVD). Others that I have worked with or seen demonstrated from time to time are distributed by companies like ComponentSource[2], (Dan Appleman's) Desaware, Apex, VideoSoft, and Dundas[3]. In any case, I recommend that you not try to launch any substantive project without first spending a few days exploring the library of controls already available in the industry. Sure, some of these controls can cost $50 or $1,000, but if you factor in the cost to duplicate even 50% of their functionality, most are well worth the one-time cost. Pay special attention to controls that supply the source code. This makes them far simpler to extend to your special needs.

[1] See www.dotnetmasters.com. Look under "Samples".

[2] See www.componentsource.com/ and www.desaware.com/index.aspx.

[3] The DVD includes free samples of most of this company's wares.

However, this chapter is more than a tour of the Visual Studio Toolbox. It introduces a new concept to Visual Studio developersthe strongly typed TableAdapter. As you'll quickly discover, I think this new technology has its place in some applications but is not a universally applicable data paradigm. Peter calls this the "over-hyped" adapterI think you'll see why he (and I) feels this way as you progress through these pages.




Hitchhiker's Guide to Visual Studio and SQL Server(c) Best Practice Architectures and Examples
Hitchhikers Guide to Visual Studio and SQL Server: Best Practice Architectures and Examples, 7th Edition (Microsoft Windows Server System Series)
ISBN: 0321243625
EAN: 2147483647
Year: 2006
Pages: 227

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net