Currently, I don't have access to the current source, but it looks like if we can change the Instance() method to allow a parameter in, it can be switched to the new datasource. Can anyone come up with an example of how best to do this?
I'm suprised this hasn't come up yet. I think it would be a common practice to have your module store/retrieve data outside of the dotnetnuke database. Should we log this in gemini?
Anyways, for those who don't know, this is how you would modify the web.config file
<configSections>
<sectionGroup name="dotnetnuke">
<section name="data" type="DotNetNuke.ProviderConfigurationHandler, DotNetNuke" />
<section name="newdata" type="DotNetNuke.ProviderConfigurationHandler, DotNetNuke" />
...
</configSections>
<dotnetnuke>
...
<data defaultProvider="SqlDataProvider">
<providers>
<clear/>
<add name="SqlDataProvider"
type="DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider"
connectionStringName="SiteSqlServer"
upgradeConnectionString=""
providerPath="~\Providers\DataProviders\SqlDataProvider\"
objectQualifier="dnn_"
databaseOwner="dbo"/>
</providers>
</data>
<newdata defaultProvider="SqlDataProvider" >
<providers>
<clear/>
<add name = "SqlDataProvider"
type = "DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider"
connectionString = "Server=DatabaseServer;Database=DatabaseName;uid=sa;pwd=sa;"
providerPath = "~\Providers\DataProviders\SqlDataProvider\"
objectQualifier = ""
databaseOwner = "dbo" />
</providers>
</newdata>
...
</dotnetnuke>
Using the DAL method, you can then change the providerType in your modules sqldataprovider file.