Sort List with string property names

For .NET 3.5 and later we can use the System.Linq.Dynamic library available for download from NuGet If we have a collection of Car objects with properties Make, Model, Year and Price... class Car { public string Make { get; set; } public string Model { get; set; } public int Year { get; …

Read

OracleDataReader GetOrDefault() extension method

The various GetXXX methods of the OracleDataReader class take a zero-based column index instead of the column name. Referring columns by index instead of name leads to hard to understand code. Additionally, the code may be susceptible to errors if the column order is modified. …

Read

IEnumerable ToCsv() extension method

In a recently concluded project that had many tabular reports, I had to display a link on each report to download the data as a comma-delimited file. Additionally, the downloaded file was expected to have a header row to help identify the columns when imported into excel. …

Read

ODP.NET CreateCommand() extension method

The amount of code to prepare an OracleCommand object to call a stored procedure is quite boring. I created a simple extension method on the OracleConnection class that makes things easiy. …

Read