O'Reilly logo

ASP.NET MVC 2 Cookbook by Richard Kimber, Andrew Siemer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Going old school with ADO.NET

In this recipe, we are going to take a look at what it takes to use some basic ADO.NET skills to make an old school data-access layer. We will continue with our repository and IoC concepts and shoehorn some inline SQL into our application.

Getting ready

As with all the other recipes in this chapter, start by copying the previous recipes code base. This will give you the core application that we created in the first recipe. From there we will build a new repository that uses ADO.NET to access the underlying data.

How to do it...

  1. The first thing that we need to do is to create a new folder for our new repository. Expand Models/Repository and add a new folder called ADORepository.
  2. Then create four new classes in that folder: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required