DotNetNuke Module Development  
Delevopment Setup|What are Private Assemblies (PA)|Installing DNN|Database|VS.NET|Web.config
 
Show as single page

Web.config

Web.config is the configuration file for a web application. It's an XML file with some predefined elements and attributes. A Web.config files can have a number of diferent entries depending on your application needs. One of this needs is giving the correct parameters to connect to the database.

This parameters are set in what is called the ConnectionString. The ConnectionString is a collection of parameters separated by semicolons that specify all needed information to connect to a given data source. For each data source you'll have diferent parameters an options. A good place to visit if you ever forgot how to setup a ConnectionString is ConnectionStrings.com.

DotNetNuke stores the database ConnectionString in two diferent places.

  1. In <appSettings> element. This entry is maintained for backwart compatibility for modules previous to version 2.0
  2. In <dotnetnuke> section. This section defines all installed data providers and sets its parameters.

In both places find the connectionString attribute and set it accordingly to your database. For example:

  • In <appSettings>:

<add key="connectionString" value="Server=localhost;Database=training;uid=trainingLogin;pwd=<...>;" />

  • In <dotnetnuke> section:

<add name = "SqlDataProvider"
type = "DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider"
connectionString = "Server=localhost;Database=training;uid=trainingLogin;pwd=<...>;"
providerPath = "~\Providers\DataProviders\SqlDataProvider\"
objectQualifier = ""
databaseOwner = "dbo"

Attention: Don't forget to set the default provider to SqlDataProvider (by default it uses AccessDataProvider)

After this changes are done and the Web.config file is saved you can open you Internet browser and point to:

http://localhost/training

When you first browse a DotNetNuke installations it creates all database tables and objects. After all this work is done, the default DotNetNuke portal should show on your browser.


VS.NET | Page 6 of 6 | Web.config

Copyright 2004 Vicenç Masanas - http://dnnjungle.vmasanas.net/
All rights reserved. No part of the contents of this information may be reproduced in any form without express permission of the author.
.