Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

telerik -- supercharge your DNN websites
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
r2i.ntegrated
 


  Sponsors  

Meet Our Sponsors

SmarterTools
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  module with different database.
Previous Previous
 
Next Next
New Post 2/27/2008 10:20 AM
User is offline Judith Barer
16 posts
10th Ranked


module with different database. 

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 5:14 PM
User is offline kelly
4 posts
10th Ranked


Re: module with different database. 

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 8:24 AM
User is offline Judith Barer
16 posts
10th Ranked


Re: module with different database. 

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 3:07 AM
User is offline kelly
4 posts
10th Ranked


Re: module with different database. 

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 Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  module with different database.
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Perpetual Motion Interactive Systems Inc.
A solutions company specializing in Microsoft enterprise technologies.
www.perpetualmotion.ca
Icthus Technologies
Building Faith on the Internet
www.icthustech.com
Efficion Consulting
A premier DotNetNuke consulting firm providing complete DNN services including: custom module development, skinning and design, installation and integration services.
www.efficionconsulting.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP