SubSonic .NET Project

Over the last year or so I've been trying to find different methods of accessing data in databases without having to write out all the usual CRUD (Create, Read, Update, Delete) code. In that time, I've come across a number of different ways to do this. Some being auto generated CRUD statements, others being abstracted DALs (Data Access Layers). The purpose of this post is to tell you about the SubSonic .NET Project.

What is it?
SubSonic is a Data Abstraction Layer. It takes your database schema and presents you with usable classes and interfaces. To access data you do something like:

// Create IEnumerable collection of products
from Products table ProductCollection coll = new ProductCollection().Load(); //
Get info on each product foreach (Product p in coll)
{ Console.WriteLine(p.ProductID + " " + p.Name + "$" +
p.Price); Console.WriteLine(p.ShortDescription); }

You can also create new records fairly easily too:

// Create a new object Product p
= new Product(); // Fill it with interesting
information p.Name = "My Most Awesomest Product";
p.Price = 99.99; p.ShortDescription = "This product is the end all,
be all. It rocks."; // Save it to the table p.Save(Profile.Username);
SubSonic can do a whole lot more than this. But these parts were the selling point
for me. Check it out at
The greatest part, is because it's a .NET Class, it can be used with ASP.NET or WinForms.

The only downside is that there is a learning curve, and it takes some time to wrap your head around what it does. Good stuff though. Makes your head go dizzy like if you stood up too fast. Check out the source with Reflector too... it's worth a read.