Step 3 - Setting Up Data Access

This step configures your application to access the SQL Server Northwind database.

  1. In the Solution Explorer, double-click the Order System Web VB project's web.config file to open it in the code-editing window. This configuration file contains settings that tell the Web application (among other things) about each database used by the application. You should see the following element that specifies the connection string for attaching to the Northwind database:

      <databases>
        <add key="Northwind\Connection" value="Data Source=(local);Initial Catalog=Northwind;Integrated Security=True" />
        <add key="Northwind\DataAccessClass" value="DataAccessSql" />
      </databases>

    Next, open up your Business Object project's app.config file. The Business Object project's app.config file is used when you test or deploy a stand-alone business object project. The Web Form project's web.config is used when you test or deploy the Business Object project along with a Web Forms project.

    Copy the entire <databases> element from the Business Object project's app.config file and completely overwrite the <databases> element in your Web Form project's web.config file.

  2. You also need to copy the Entity Framework connection string found in the app.config <connectionStrings> element. Copy this element from your Business Object project's app.config file and paste it into your Web Form Project's web.config file immediately after the </databases> element. Your web.config file should look something like this:

    <databases>
    	<add key="Northwind\Connection" value="Data Source=(local);Initial Catalog=NorthwindCF;Integrated Security=True" />
    	<add key="Northwind\DataAccessClass" value="DataAccessSql" />
    	<add key="EntityDataModelContainer\DataAccessClass" value="DataAccessSqlEF" />
    </databases>
    <connectionStrings>
    	<add name="EntityDataModelContainer" connectionString="data source=(local);initial catalog=NorthwindCF;integrated security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
    </connectionStrings>

  3. Close the web.config file and save changes

For more information on connection strings see the Help topic How Database Connections Work in MM .NET.

See also:
Step 4 - Setting Up the Master Page


© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 04/25/18
Comment or report problem with topic