Coolness of SubSonic

by percent20 1/23/2008 5:17:00 PM

From my last post SQL Parameters in C# I mentioned that I wanted to learn an ORM package.  Well I took a quick glance at NHibernate and got overwhelmed and decided to take a look at SubSonic as I have heard a lot of good things about it.  Well I am happy to say I doubt I will EVER do database access by hand ever again if I can help it.  As such I figured I would make a code post on some SubSonic code.  I am not really going to explain it just want to show you how easy, cool and simple it is.  I'll show the code starting with my .aspx main aspx page code, the code behind then the data access layer code.

.aspx Code

Code Behind

DataAccess Class

Product Class

I am also including the project I used too.  Be sure you have Northwind database.

I suggest you download, install, and start using SubSonic.  It is a great framework to help generate and create your DAL.  Once you have it I suggest you watch the screencast on the using the Query Tool.  If you would like me to explain this code i'd be more than happy to just let me know and I'll make another post.

SubSonicTest.zip (188.54 kb)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

.NET | Sql Server

Related posts

Comments

1/23/2008 10:11:32 PM

Gustavo

Subsonic seems to be funny at the start, but if you want to control your business entities and not merely do activerecord it is not a good way, it is better to spend some more minutes on NHibernate or other OR/M with same capabilities.
If you are not interested in having a domain from yours and start modeling from the DB then this is your way to go...

Gustavo.

Gustavo us

1/24/2008 3:20:48 AM

Buddy Lindsey

I am still going to learn NHibernate and probably other OR/M packages it just really freaked me out when i first started looking at it. It was going way over my head. I'll be the first to admit I need to work on learning more about application architecture. So that is what I am going to spend time doing using SubSonic as my data access then in a few months try to learn NHibernate again.

Buddy Lindsey

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

8/7/2008 1:17:47 PM

Powered by BlogEngine.NET 1.3.0.0
Theme by Mads Kristensen


My Flare

AddThis Feed Button

National Blog Posting Month

Eagle Scout

I'm Test Driven

[Reserved for MVP status I want to earn]

View Buddy Lindsey's profile on LinkedIn

Twitter



Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Sign in