Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Specifying a seperate custom database for my custom module?Specifying a seperate custom database for my custom module?
Previous
 
Next
New Post
3/15/2006 8:20 PM
 

Hi there,

I have been developing our companies intranet portal using DotNetNuke 3.0.
All the custom modules I have implemented work fine when using the standard default SqlDataProvider for DotNetNuke.

However I need my modules to store and retrieve data from a second seperate Sql Database.

I have tried the following, however have had no luck:

web.config (added lines only)
------------

<sectionGroup name="dotnetnuke">
<section name="Guardiandata" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
</sectionGroup>

<appSettings>
<add key="GuardianSiteSqlServer" value="Server=(local);Database=TestData;uid=myuserID;pwd=myUserPassword;" />
</appSettings>

<guardiandata defaultProvider="GuardianSqlDataProvider">
<providers>
<clear />
<add name="GuardianSqlDataProvider" type="DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider" connectionStringName="GuardianSiteSqlServer" upgradeConnectionString="" providerPath="~\Providers\DataProviders\SqlDataProvider\" objectQualifier="" databaseOwner="dbo" />
</providers>
</guardiandata>


SqlDataProvider.vb (added lines only)
----------------------

#Region "Private Members"
   Private Const ProviderType As String = "Guardiandata"
  Private _providerConfiguration As Framework.Providers.ProviderConfiguration = Framework.Providers.ProviderConfiguration.GetProviderConfiguration(ProviderType)
  Private _connectionString As String
  Private _providerPath As String
  Private _objectQualifier As String
  Private _databaseOwner As String
#End Region

When I try perform a database operation with my custom module it throws the following exception:

DotNetNuke.Services.Exceptions.ModuleLoadException: The type initializer for "Horsetorque.DNN.Modules.ProductManager.Data.DataProvider" threw an exception. ---> System.TypeInitializationException: The type initializer for "Horsetorque.DNN.Modules.ProductManager.Data.DataProvider" threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Key cannot be null. Parameter name: key at System.Collections.Hashtable.get_Item(Object key) at Horsetorque.DNN.Modules.ProductManager.Data.SqlDataProvider..ctor() in C:\Dotnetnuke\DesktopModules\ProductManager\Providers\SqlDataProvider\SqlDataProvider.vb:line 26 --- End of inner exception stack trace --- at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at DotNetNuke.Framework.Reflection.CreateObject(String TypeName, String CacheKey) at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectProviderName, String ObjectNamespace, String ObjectAssemblyName) at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectNamespace, String ObjectAssemblyName) at Horsetorque.DNN.Modules.ProductManager.Data.DataProvider.CreateProvider() in C:\Dotnetnuke\DesktopModules\ProductManager\Components\DataProvider.vb:line 20 at Horsetorque.DNN.Modules.ProductManager.Data.DataProvider..cctor() in C:\Dotnetnuke\DesktopModules\ProductManager\Components\DataProvider.vb:line 15 --- End of inner exception stack trace --- at Horsetorque.DNN.Modules.ProductManager.Data.DataProvider.Instance() at Horsetorque.DNN.Modules.ProductManager.Business.CustomerCareRegistrationClientsController.AddCustomerCareRegistrationClients(CustomerCareRegistrationClientsInfo objCustomerCareRegistrationClients) in C:\Dotnetnuke\DesktopModules\ProductManager\Components\ProductManagerController.vb:line 22 at Horsetorque.DNN.Modules.ProductManager.ProductManagerEdit.cmdUpdate_Click(Object sender, EventArgs e) in C:\Dotnetnuke\DesktopModules\ProductManager\ProductManagerEdit.ascx.vb:line 238 --- End of inner exception stack trace ---

When I change the SqlDataProvider.vb ProviderType back to "data" the error does not occur, however the module will not work because the stored procedures do not exist in the default DotNetNuke database.

Is there a section I am not adding in the web.config?

Thanks in advance

 
New Post
3/15/2006 11:30 PM
 

Fixed the problem, after some more research I found the following issues and corrected them:

I had different case for the Section group name and the key configuration key defined.

Changed "GuardianSqlDataProvider" to just "SqlDataProvider" and set the defaultProvider for the config section to "SqlDataProvider".

It all works fine now

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Specifying a seperate custom database for my custom module?Specifying a seperate custom database for my custom module?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out