Create a Northwind Data Access Project

Purpose:

To create a project dedicated to data command classes. These classes will provide all access to the database for the rest of the solution.

Starting Point:

You have the Northwind solution open.  You should already have a Web forms project in the solution.

Steps:

  1. Choose `New", `Project' from the File menu.
  2. Select `Class Library' as the project type.
  3. Name the Project `Northwind.DataAcess'.
  4. Save the solution and close it.
  5. Find the folder `Northwind.DataAccess' in your Northwind solution folder. Rename it to DataAccess.
  6. Re-open the Northwind solution. The program will complain that it can no longer find the `Northwind.DataAccess' project. Click OK to continue.
  7. Right-click on the Northwind.DataAccess project in the Solution Explorer and select Remove from the context menu.
  8. Right-click again on the solution in the Solution Explorer, and select "Add Existing Project'.  Navigate to the Northwind.DataAccess project and select it.

Rationale:

We need a project to hold all of code that provides access to the database if we want to have one and only one copy of that data access code.  By definition, this means a project that lives between the database and the rest of the application. 

Discussion:

Note that this presents an alternative method of dealing with namespace and project naming issues. Compare this with the way we set up the namespaces in the original web project. The goal of each is to end up with a project naming structure that is mirrored by the directory structure for the solution. Which way you choose to do it depends solely on which you like better.

 

Previous Step: Create the Northwind Solution

Next Step: Create Region Helper Class