Back in 2002 and 2003 I was mainly doing VBA type work, hacking together reporting tools using only the resources I had at hand. The kind of things that still haunt me to this day. In short: I wasn’t terribly experienced.
For the first 5 weeks of 2004, I (along with a former colleague, now friend) wrote a .NET 1.1 app that is still in use today. Looking back now, I realise the code (for the client portion - which was my portion) is terrible. But, the good thing was that all parties were happy, and for the most part - the application needs very little maintenance. (If you can call burning a SQL Backup file to DVD once a week “maintenance”)
Anyway, to cut a long story short: I needed to make some fairly minor changes - mainly to remove a few things that are no longer needed, and to change the server referenced in the installer*. All of the business logic is in the database, just a few things to manage the display of that data.
I decided to rebuild the client in Visual Studio.NET 2005 (up from VS 2002). I’ve spent about 3 hours on it so far, and I’ve got all the major interface elements done.
All the field elements were pulled from a dataset I created that maps all the existing stored procedures. If I needed a field - I dragged in that field. If I needed an entire datagrid - I dragged in a TableView.
VS.NET 2005 went and did the heavy lifting of writing the code that goes and loads the data from the database, and setting databinding on the fields.
There will be, of course, some things that will take longer - but hey, even if I spend another day on it - that’s still a fraction of the time spent originally.
All up - Winforms Databinding in VS 2005 really does rock.
*: Due to my inexperience, I implemented an… “interesting” way of determining the environments (production/development/etc) available — asking the current default server, which was initially set by the installer. Yeah, I didn’t think that one through properly.
