Whilst LINQ is almost here, there is still a place in the world for plain old ADO.NET programming. However, procedural ADO.NET code can often be cumbersome to write. Executing some SQL for a data reader can involve three nested layers of C# using statements.
In this screencast, I present a functional approach to using ADO.NET that wraps most of the boiler-plate code into a Database class.
It makes use of anonymous methods to allow the developer to provide the required code at different points in the ADO.NET code.
The result is a syntactically lightweight way to interact with a database.
The code used in the project can be downloaded here:
C# 3.0 http://www.aboutcode.net/screencasts/functional-ado.3.zip
C# 2.0 http://www.aboutcode.net/screencasts/functional-ado.2.zip
(same as 3.0 but with non-inferred anonymous methods).