Microsoft.Data.dll - “Someone on the Internet is wrong!”

I’ve had a few posts on the topic of Microsoft.Data.dll sitting open in my browser for a few days, and I keep coming back to them trying to work out what I think of it. In some ways it doesn’t matter, because I’m never going to use it – which is fine, because I’m not the intended demographic.

If you’ve not seen it already and want to get enraged/interested (pick one!), then basically the syntax is a simplification of ADO.NET and LINQ allowing queries such as the following:

  using (var db = Database.OpenFile("Northwind")) {
        foreach (var product in db.Query("select * from products where UnitsInStock < @0", 20)) {

            Response.Write(product.ProductName + " " + product.UnitsInStock);



A lot of the rage against it seems to be that we shouldn’t make it easier for people to shoot themselves in the foot by writing bad code, but is that really the responsibility of the framework? I’m sure you’ll find people doing stupid things with Entity Framework, NHibernate, LightSpeed, LLBLGenPro, not to mention more obvious candidates such as old school ADO.NET, PHP and hundreds of other technologies.

The post Microsoft.Data, because the 90s were so good, we want to do them again made me realise that a lot of people want to think that everyone out there knows about SQL injection, isn’t coding SQL directly in their web applications, and is thinking carefully about their data access strategy simply because it’s 2010 – but that’s just not true. People have and will continue to create bad code no matter what tools are available to them for a variety of reasons, and nothing that anyone can ever do will eliminate that completely as long as humans are walking, sitting and coding.

It leads me to thinking about some of the official ASP.NET examples floating around, a lot of which can simply be misleading to a new developer. Showing someone how to drag, drop and configure a DataSource control and then throw it against a GridView is all good and well, but it’s not the only way to do things – it’d give a better view of the overall picture to have a few different levels of example available so the new reader has a chance to peruse a few examples – even if they pick the simple example to start with, maybe at least they’ll be aware that there are other options out there and make a mental note to go and read more one day.

So many of the ASP.NET examples which Microsoft provides work”, but are hardly used in professional development. How is someone new to the technology stack supposed to know that other than finding out the hard way?

I guess I just don’t see people trying to act all puritan simply because a framework they’re passionate about contains something they don’t like or won’t use as being overly constructive. I can see where the passion comes from (especially given some of those developers will inherit something done wrong one day and scream WHY OH WHY), but I’m really having a hard time getting outraged at providing developers with other options. Without thinking about this too much, I’d probably prefer to come across someone using the code snippet above than some of the other horrible half assed approaches to data access I’ve seen in my time – simply because of the fact that the LINQ query above would be a great candidate for some quick wins via some easy refactoring.

To me it’s the naming of the DLL that’s the worst part – Microsoft.Data really does sound quite official – Microsoft.Data.Lite or something which signifies that it is by no means the end all and be all choice when it comes to data access might have been a much better choice, as well as being a simple way to give new developers a clue that there’s a bigger world out there – the world of ranting in blog comments about the “right” way to do things.

Link: Microsoft.Data.dll - A re-introduction

Link: Introduction to Microsoft.Data.dll

Link: Microsoft.Data: Why It's Not All Bad

Tags: , , ,

 Print | Posted on Wednesday, August 11, 2010 8:58 PM |


No comments posted yet.

Post Comment

Website / Url

Your comment

Ensure the word in this box says 'orange':
Please add 4 and 5 and type the answer here:

Due to excessive comment spam, all comments are now being moderated. If you're a comment spammer then you're wasting your time here. Your comments will not be published - ever.

About me

My name is Ross Hawkins and I'm a developer, consultant, business owner and writer based in Auckland, New Zealand (pictured below!). My current work revolves around ASP.NET, C#, jQuery, Ajax, SQL Server, and a mix of other Microsoft development technologies.

I also have about 15 years of experience with IBM Lotus Notes/Domino and associated technologies. While Notes/Domino is no longer my primary focus I still like to dabble and keep my skills up to date.

I own and run 2 businesses - Hawkins Consulting Services, and Ignition Development.

Bethells Beach, located in sunny West Auckland, New Zealand


Subscribe to this feed


Popular Content

Troubleshooting WebResource.axd

The .NET 2.0 framework changed the way clientside JavaScript is delivered to the browser. Previously, ASP.NET 1.1 used the aspnet_client directory whereas now 2.0 uses WebResource.axd.

Published on October 8, 2006

Useful IIS Rewrite Rules

The IIS Rewrite Module is easy to use, however for some rules it can take a bit of trial and error to get your syntax correct. After using it for many projects across multiple customers, I thought it might be useful to put up a post containing a small collection of the useful rules I’ve come across, for your copying and pasting pleasure.

Published on January 14, 2014

jQuery Wildcard Selectors - some simple examples

I wrote about jQuery wildcard selector syntax briefly back in 2009, and since then that post has received a lot of views – way more than a post that brief should ever have seen..

Published on October 14, 2011

Microsoft AJAX Extensions: Sys.Debug is null or not an object

One of the breaking changes which was made with the 1.0 release of the Microsoft Ajax Extensions was the renaming of the 'Debug' class to 'Sys.Debug' for reasons of compatiability with other frameworks. Breaking changes like this can often be a source of frustration..

Published on May 22, 2007

Simple ASP.NET Character Counter

A textbox character counter is a pretty simple piece of functionality, and there's a lot of different ways to apply one to your application. The following method is nice and simple, and can be done using only clientside JavaScript if required, or combined with server side code in order to create a more dynamic effect

Published on December 4, 2006

Simple ASP.NET Character Counter - with Master Page Support

A quick update to my previous character counter article adding some changes for those using it with Master Pages.

Published on February 7th, 2009

Adding Tooltips to Gridview Headers

As the title says, this is a very simple but dynamic way of achieving tooltip text on a header column. It's not overly flash, but it's lightweight and quick to implement.

Published on April 15, 2007

SQL Server Web Report Viewer Issues on Windows 2008 Server/IIS7

A fix for another AXD related issue, this time with the SQL Server Web Report Viewer Control which was being served up via IIS7 on a Windows 2008 server.

Published on June 2, 2007
Updated on April 10, 2008


December, 2014 (1)
November, 2014 (3)
October, 2014 (2)
August, 2014 (3)
July, 2014 (1)
June, 2014 (2)
May, 2014 (4)
April, 2014 (1)
March, 2014 (4)
February, 2014 (3)
January, 2014 (4)
December, 2013 (6)
November, 2013 (2)
October, 2013 (3)
September, 2013 (5)
August, 2013 (5)
July, 2013 (3)
June, 2013 (2)
May, 2013 (3)
April, 2013 (2)
March, 2013 (2)
February, 2013 (3)
January, 2013 (5)
December, 2012 (4)
November, 2012 (4)
October, 2012 (3)
September, 2012 (3)
August, 2012 (4)
July, 2012 (1)
June, 2012 (4)
May, 2012 (2)
April, 2012 (4)
March, 2012 (2)
February, 2012 (4)
January, 2012 (3)
December, 2011 (3)
November, 2011 (8)
October, 2011 (9)
September, 2011 (8)
August, 2011 (5)
July, 2011 (4)
June, 2011 (7)
May, 2011 (5)
April, 2011 (3)
March, 2011 (8)
February, 2011 (4)
January, 2011 (3)
December, 2010 (8)
November, 2010 (5)
October, 2010 (6)
September, 2010 (7)
August, 2010 (11)
July, 2010 (12)
June, 2010 (8)
May, 2010 (8)
April, 2010 (4)
March, 2010 (8)
February, 2010 (6)
January, 2010 (12)
December, 2009 (13)
November, 2009 (11)
October, 2009 (12)
September, 2009 (12)
August, 2009 (2)
July, 2009 (7)
June, 2009 (12)
May, 2009 (9)
April, 2009 (9)
March, 2009 (9)
February, 2009 (8)
January, 2009 (7)
December, 2008 (6)
November, 2008 (7)
October, 2008 (9)
September, 2008 (12)
August, 2008 (9)
July, 2008 (6)
June, 2008 (24)
May, 2008 (13)
April, 2008 (16)
March, 2008 (8)
February, 2008 (10)
January, 2008 (1)
December, 2007 (14)
November, 2007 (11)
October, 2007 (11)
September, 2007 (13)
August, 2007 (11)
July, 2007 (5)
June, 2007 (15)
May, 2007 (11)
April, 2007 (9)
March, 2007 (9)
February, 2007 (10)
January, 2007 (8)
December, 2006 (18)
November, 2006 (11)
October, 2006 (14)
September, 2006 (9)
August, 2006 (10)
July, 2006 (4)
June, 2006 (4)
May, 2006 (6)
April, 2006 (3)
February, 2006 (6)
January, 2006 (10)
September, 2005 (2)
August, 2005 (4)

Post Categories

NZ Trains
Visual Studio
Web Development