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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0module with different database.module with different database.
Previous
 
Next
New Post
2/27/2008 2:20 PM
 

I am a newbie at DNN and VB.Net.  I created a module following the tutorial on the codeproject web site.  The link is www.codeproject.com/KB/applications/LCTDNNModDev.aspx

It is a really good tutorial.

Following the tutorial I created a table in the DNN database but I would like to use this module with a table in a different database.  What would be the easiest way yto do that?

If I create another connection string in web.config, how do I tell the module which connection string to use?

The module was built using the DotNetNuke Dynamic Module template.  Also I was wondering if I could change the sqldataprovider.vb file that I assume was created by the template, to access a different database.  I see that there is code in the sqldataprovder.vb as follows;

' Read the configuration specific information for this provider

 

Dim objProvider As Framework.Providers.Provider = CType(_providerConfiguration.Providers(_providerConfiguration.DefaultProvider), Framework.Providers.Provider)' Read the attributes for this provider

 

'Get Connection string from web.config

_connectionString = Config.GetConnectionString()

 

If _connectionString = "" Then

 

' Use connection string specified in provider

_connectionString = objProvider.Attributes(

 

"connectionString")End If

It looks like I should be able to set the objprovider.attribute.connectionstring but I do not know how. 

Any help would be appreciated. 

Thanks

Judith 

 

 
New Post
2/27/2008 9:14 PM
 

Try:

Dim objProvider As Framework.Providers.Provider = CType(_providerConfiguration.Providers(<your_provider>), Framework.Providers.Provider)' Read the attributes for this provider  'Get Connection string from web.config

 

_connectionString = Config.GetConnectionString(<your_connection_string>)

 
New Post
2/28/2008 12:24 PM
 

I added the connection string to the web.config.  I put the following code in the sqldataprovider.vb for the module I created

'Get Connection string from web.config

_connectionString = Config.GetConnectionString("StarkConnectionString")

 

When I try to run the web site, it says that there was a critical error and no data is being displayed for any of the other modules, as if now it is using the above connection string across the entire web site instead of just within this module.  What am I doing wrong and what should I be doing?

Thanks

Judith

 
New Post
2/29/2008 7:07 AM
 

Look at the entry in your post above the connection string. If you aren't using the same provider as the site default, you'll have to add the name of your provider there. You'll also have to add an entry for the provider in web.config

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0module with different database.module with different database.


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