Typed Datasets and .NET 2.0

For the next few months, I will be middleware.  I will be everywhere in our enterprise, integrating systems.  One of the Prime Directives is “get it done fast!”  We’re not looking for beautifully architected n-tier solutions that can be abstracted and inherited ad infinitum.  Just make the ERP talk to the WMS, and back again.  It doesn’t need to last forever, we’re going to rip everything apart and implement the latest best solutions again in a few years anyway.

There are about as many ways to get retrieve and handle data as there are developers with string opinions–object-relationship mappers, custom business objects, strongly typed datasets, etc.

In Visual Studio 2005, MS really improved the designers for strongly-typed datasets.  These aren’t everyone’s favorite method of handling data, but they work, and they can be put together quickly, and I like them for some purposes.  Here are three excellent articles on using strongly-typed datasets in an application.

Build a Data Access Layer with the Visual Studio 2005 DataSet Designer, Brian Noyes

A good data access layer is critical for most business applications, whether that layer resides on a middle tier application server, a web server or on the client. Data access layers tend to involve a lot of error-prone, repetitive coding if you try to do it by hand. You can alleviate some of that by designing a good set of base and helper classes to encapsulate the repeating patterns, or by using a code generation tool. However, you still usually have to write all the data access methods by hand for the ad-hoc queries that service large parts of your application.

If you are using Visual Studio 2005, that does not have to be the case. Some significant improvements have been made to the Visual Studio 2005 DataSet designer and the code that it generates that make it so you will rarely have to write your data access methods by hand of you choose to work with DataSets. In this article, I’ll walk you through what those features are and how to use them. I’ll also discuss some of the pros and cons of using the new features and give some guidance on when you might want to do something different.

Building a DAL using Strongly Typed TableAdapters and DataTables in VS 2005 and ASP.NET 2.0, Scott Guthrie

Using the data designer and ASP.NET 2.0 together, you should be able to create a core DAL implementation and build from scratch a data-driven UI web app on top of an existing database very quickly (~10-15 minutes to build an application from scratch that supports master/details filtering along with data paging, sorting, insertion, and editing).

Using Strongly-Typed Data Access in Visual Studio 2005 and ASP.NET 2.0, Joseph Chancellor

Specifically, we will see how to create and use strongly-typed DataSets in Visual Studio 2005. As this article explores, strongly-typed DataSets offer a number of advantages over alternative, loosely-typed data access techniques and, with Visual Studio 2005, creating and using strongly-typed DataSets has never been easier. Read on to learn more!