Ramani Sandeep's Blog

DotNetting – Fast , Easy Way of Developing Applications

Archive for the ‘Web Matrix’ Category

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

Posted in ASP.NET 4.0, Web Matrix | Tagged: , , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 317 other followers