1、注册
 

 <configSections>

        <sectionGroup name="dotnetnuke">

            <section name="data" type="DotNetNuke.ProviderConfigurationHandler, DotNetNuke" />

        </sectionGroup>

    </configSections>
2、 连接字符串设置

<appSettings>

        <add key="connectionString" value="Server=localhost;Database=DotNetNuke;uid=sa;pwd=;" />

    </appSettings>

3、定义属性
 

  <dotnetnuke>

        <data defaultProvider="SqlDataProvider" >

            <providers>

          <clear/>

                <add name = "SqlDataProvider"

                        type = "DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider"

                        connectionString = "Server=localhost;Database=DotNetNuke;uid=sa;pwd=;"

                        providerPath = "~\Providers\DataProvider\SqlDataProvider\"

                        objectQualifier = "DotNetNuke"

                        databaseOwner = "dbo"

                />

                <add name = "AccessDataProvider"

                        type = "DotNetNuke.Data.AccessDataProvider, DotNetNuke.AccessDataProvider"

                        connectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"

                        providerPath = "~\ Providers\DataProvider\AccessDataProvider\"

                        objectQualifier = "DotNetNuke"

                        databaseFilename = "DotNetNuke.resources"

                />

            </providers>

        </data>

    </dotnetnuke>