C#: 4.0 Anonymous Types

Please see my other C# articles. Simple, elegant data storage. One of the latest improvements to the .NET Framework in 4.0 is the ability to use object initializers to create simple data-storage objects without having to create a class or struct. Also, these anonymously-typed objects are created by the compiler so you still have strong-typing on your…

C#: ADO.NET Transactions

Please see my other C# articles. Ensuring data-concurrency. When a feature requires an atomic action, ADO.NET transactions easily ensure data concurrency while performing writes against the database.For example, let’s say two separate db writes are needed, each of which executes a stored procedure.Should errors occur, it’s essential that both writes are rolled-back before any changes are…