Creating a Money Type

Published on Author Michael

.NET does not have a type to represent monetary values. In general you will simply use Decimal as it has the necessary accuracy. This has some limitations though: Without looking at surrounding code it is difficult to tell if a variable represents money or simply a large decimal value Currency information is not part of… Continue reading Creating a Money Type

Categories C#

Simplifying ADO.NET Data Access, Part 6

Published on Author Michael

Time to finish up the series on simplifying data access using ADO.NET. We have simplified everything around ADO.NET except for actually retrieving the results. This is probably the most complicated part of ADO.NET given the need for cleaning up the reader, enumerating the results and reading the actual data. We can simplify all this logic… Continue reading Simplifying ADO.NET Data Access, Part 6

Simplifying ADO.NET Data Access, Part 5

Published on Author Michael

This is a continuation of the series on simplifying data access using ADO.NET.  We have a little cleanup to do around parameters before finishing up the series. Generic Parameters In the last article we defined the DataParameter class to represent a (database agnostic) parameter and value. At the time we used object for the type… Continue reading Simplifying ADO.NET Data Access, Part 5

Simplifying ADO.NET Data Access, Part 4

Published on Author Michael

This is a continuation of a series on simplifying the use of ADO.NET. In the last article we added the ability to cleanly separate query definition from the underlying data provider. But we left out parameters which are generally critical (and specific) to ADO.NET providers. In this article we will add support for parameters and… Continue reading Simplifying ADO.NET Data Access, Part 4