Ramani Sandeep's Blog

DotNetting – Fast , Easy Way of Developing Applications

Massive: 400 Lines of Data Access Happiness

Posted by Ramani Sandeep on February 23, 2011


Rob Conery blogs about an interesting lightweight data access he’s writing for WebMatrix that’s focused on simplicity and driving .NET 4 dynamic support for all it’s worth.

Massive is a “wrapper” for your DB tables and uses System.Dynamic extensively. If you try to use this with C# 3.5 or below, it will explode and you will be sad. Me too honestly – I like how this doesn’t require any DLLs other than what’s in the GAC. Yippee.

  • Get a Database. Northwind will work nicely. Add a connection to your database in your web.config (or app.config). Don’t forget the providerName! If you don’t know what that is – just add providerName = ‘System.Data.SqlClient’ right after the whole connectionString stuff.
  • Create a class that wraps a table. You can call it whatever you like, but if you want to be cool just name it the same as your table.
  • Query away and have fun

Read more…

Hope this will helps !!!

Jay Ganesh

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 124 other followers

%d bloggers like this: