his installment of "The Baker's Dozen" covers some of the major features in Visual Studio 2005.
Visual Studio 2005 offers language, data handling, and development environment enhancements that are sure to please many developers. Programmers who are currently using Visual Studio .NET 2003 will find many ways to write more efficient code and increase their overall productivity. In addition, programmers who are new to .NET will find the migration to Visual Studio 2005 a bit easier than the migration to the first version of .NET. While it's not possible to talk about every new feature in Visual Studio 2005, this article will cover many of the primary changes and enhancements.
Beginning with the End in Mind
When I buy something (software, consumer electronics, etc.), it's important for me to know the capabilities of the item I'm purchasing. I prefer to know up front what's "under the hood" as opposed to finding out later. In our industry, developers and users feel the same way: they want to know the capabilities of a tool or product they're about to use. So the objective of this article is to help developers new to Visual Studio 2005 become more aware and knowledgeable about the different areas where Microsoft has improved and enhanced .NET.
Baker's Dozen Spotlight:
- Performance and functional enhancements to ADO.NET
- Language enhancements to C#
- Language enhancements to Visual Basic
- New Windows Forms capabilities
- New Web applications capabilities
- Click-once capabilities
- New features in the Visual Studio IDE to increase developer productivity
- SQL Server 2005 enhancements
- Crystal Reports.NET enhancements
- New features in the Visual Studio debugger
- Visual Studio 2005 Tools for Microsoft Office (managed code add-ins)
- An overview of Visual Studio Team System
- The new XML editor
With each tip, I'll take a Sergeant Joe Friday..."the facts, just the facts"
approach. Various sites, articles, and books (some of which I'll mention) cover these areas in detailit's my objective to make you more generally aware of what's under the hood in 2005, using a release notes approach. As much as possible, I'll bold keywords and important topics, and you're encouraged to research these further, either in the (greatly improved) on-line Help, and/or the suggested reading sources.
|The objective of this article is to help developers new to Visual Studio 2005 become more aware about the different areas where Microsoft has improved and enhanced .NET. Think of this as a set of "release notes" to find out what's under the hood of 2005.|
Reason 1: The Baker's Dozen Spotlight: ADO.NET 2.0
Years ago I attended a Jethro Tull concert. Ian Anderson came out and started with Aqualung
. Many of us were surprised that he started a concert with (arguably) their signature piece. But it only got better from there, so I'll start with the area that I think shines the most in Visual Studio 2005: improvements in ADO.NET.
: Microsoft has made two significant enhancements to ADO.NET that result in better performance. First, they rewrote the indexing engine for better performance. As a result, many operations execute more quickly, especially as the size of a dataset grows. Increases in performance will vary based on many application environment factors, but many applications should see increases by a factor of two or greater. One test published on MSDN that inserted a million rows into a data table took 30 minutes in Visual Studio .NET 2003 and 45 seconds
in Visual Studio 2005! Lesser amounts of data will result in lower orders of magnitude; but in general, insert, update, delete, Fill, and Merge operations will execute more quickly in Visual Studio 2005.
Second, many developers know that passing and returning datasets across physical boundaries carries substantial overhead and incurs performance penalties. ADO.NET 2.0 supports true binary serialization in remoting environments by providing a new RemotingFormat property, which a developer can set to SerializationFormat.Binary.
Depending on the size of the dataset, the binary serialization may yield a result as much as six times smaller than XML serialization, resulting in faster transfer speeds and smaller required bandwidth resources. Note that this enhancement only works in remoting environments: because Web services (by definition) pass XML.
Datatable independence! In Visual Studio .NET 2003, several methods were only available for the dataset. One example is writing (and reading) XML data: a developer who wanted to write the contents of a data table to an XML file had to create a dataset, add the data table to the dataset, and use the dataset's WriteXml method. ADO.NET 2.0 now provides the same method for the data table. The following is a full list of methods that are available at the data table level:
In addition, ADO.NET 2.0 allows a developer to serialize a data table in both remoting and Web service scenarios. The new RemotingFormat
property described above also applies to the data table.
DataView.ToTable: ADO.NET 2.0 allows developers to create a new data table from any dataview. The ToTable method also contains an overload for the developer to create a subset list of columns in the new table.
Bulk Copy: ADO.NET 2.0 contains a new SqlBulkCopy class to perform bulk inserts of data from a .NET application to SQL Server. Any object that implements IDataReader can utilize the SqlBulkCopy capability.
Provider factories: In ADO.NET 1.1, supporting multiple data providers meant coding a CASE statement and IDbConnection. ADO.NET 2.0 has new provider factory classes to instantiate the desired provider type. At the end of this section, I'll provide an excellent reference that covers this in detail.
Miscellaneous features: You can now fill a DataTable with a DataReader (and vice-versa). There's a new SqlConnection class to obtain connection statistics, improved connection-pool handling, and multiple active result sets when using SQL Server 2005 and namespace-qualified tables.
I'm very pleased with the enhancements in ADO.NET 2.0. There are some enhancements that I hope Microsoft will consider for the next version. Even with the new independence of the data table, there are still capabilities that require a dataset. For instance, you can only establish a data relation between two data tables in the same dataset. Situations where master codes exist in multiple transaction tables require some additional coding when relations need to be established.
- Generic Coding with the ADO.NET 2.0 Base Classes and Factories by Bob Beauchemin MSDN). Bob Beauchemin has several excellent ADO.NET 2.0 articles online on MSDN.
- New Dataset Features in ADO.NET 2.0 by Jackie Goldstein (MSDN)
- Flex Your Data: Teach Old Data New Tricks with the Fully Loaded Advances in ADO.NET 2.0 by Julia Lerman (MSDN)