I'm an ORM convert

When I code a database-based application such as C# WinForms with Microsoft SQL Server, I've always been writing out the command, then returning a SqlDataReader object, then when updating records, write out either an INSERT or UPDATE stored procedures. I saw a LLBLGen ORM mapper, and walked away pretty impressed. Frans Bouma kept insisting that stored procedures are a waste of time and dynamic SQL is just as good. Hmm, with SQL Server 2005, I'm sure the performance enhancements to it makes for speedy dynamic SQL calls. The biggest advantage of stored procedures at this day and age would be security -- especially web-based applications. You can secure stored procs at the user or role level and not worry about hackers accessing the tables itself. On the other hand, running parameters-based queries can be just as good and at the same time prevent SQL injection attacks.

Now, with all that pros and cons of developing with SQL, Microsoft is coming out with a technology in .NET 3.5 called LINQ. While I walked away impressed with the dynamic-ism where you can just write an interpreted query in code... wow! Being on the .NET 2.0 Framework, I wanted to dabble with something like that NOW.

After some searching, I came across MyGeneration Software's dOOdads. Neat name! While dOOdads is somewhat not in active development, but its still free! (the maintainer's now working on a paid version of dOOdads, EntitySpaces and its worth a look!) While I'm working on this project using dOOdads, I came across a new one and from what I've been hearing, it's pretty good too: SubSonic. I'm sure its too late to switch ORM mappers at this point, but will try out SubSonic for my next project.

But regardless, one way or another, my goodness, it's so nice to have the MyGeneration application generate codes for me using the variety of libraries available to create stored procs, the C# (and VB.NET) Data Layer codes to access the database, etc... Trust me, try one of those ORM mappers and your life as a developer will forever change.

No more declaring SqlConnection, SqlCommand, setting up SqlParameters, Close et al... Using the combo of MyGeneration and dOOdads, all I have to do is this:

Clients c = new Clients();
c.LoadByPrimaryKey(1);
MessageBox.Show(c.FirstName);

... see that? 3 freakin' lines! Clients is the name of the DataTable object used by dOOdads, AND its also the SQL table's name that's in my database. Niceeee....

See, I'm an ORM convert.