Softwire Blog


Generic collections in C#


16 July 2012, by

Over the next few weeks I’ll be publishing a short series of posts introducing Language Integrated Query (LINQ). However to use LINQ well it’s important to have a basic understanding of Generics, so my first post covers this topic. For nostalgia value, I’ve included a little bit of history from the heady days of .NET 1.1, and some advice for anyone who’s coming back to .NET programming having not used it since those days.

(more…)

Recovering data from a corrupted Excel spreadsheet using PowerShell


27 March 2012, by

It’s the last thing anyone wants to see at 5pm after spending the day updating an important spreadsheet:

Excel found unreadable content

I’ve had this once or twice before and Excel has always managed to recover my data perfectly. But on this occasion, Excel simply crashed half way through the recovery process – and continued to do so on all subsequent attempts.

My first thought was of course to look to my backups, but I had nothing more recent than from the previous night – not much comfort after the best part of a day’s effort. Even a Google for “Excel file recovery” didn’t do much good – I downloaded a couple of free trials, but none gave satisfactory results. One did claim to have successfully recovered my data, but did so suspiciously quickly and was unable to display a preview of what it had done. I didn’t trust it sufficiently to click the “Buy Now” button. Help!

(more…)

DataSet performance in .NET web applications


4 August 2011, by

A DataSet is (to quote Microsoft) an in-memory cache of data. Essentially it’s a snapshot of part of your database. DataSets can be very useful, but they have some significant annoyances too.  This article sets out a few of the key problems, and some possible solutions to attempt, based on extensive experience from building and (more significantly!) maintaining our Reservwire travel reservation product.

(more…)