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 ...Connecting your DotNetNuke® Module to another databaseConnecting your DotNetNuke® Module to another database
Previous
 
Next
New Post
5/13/2007 11:53 AM
 

Michael's great tutorial left me with additional questions. Particularly, how to leverage a seperate connection string in the web.config and how to code it in the code-behind.

One thing I learned (and this goes back to Michael's statement of a developers thinking there is an "official" DotNetNuke way of connecting to a database) is if I create a connection string in the web.config I can drag gridviews, formviews, etc onto my page and use that connection string for the SqlDataSource. I am under the assumption that this is not the correct or "official"  way of doing things. It does make the development of the module easier, but I'm a clean freak and want code in the code behind. Hence, the question above. Personally, it is far more beneficial for me to reference the web.config and retrieve the connectionstring as opposed to hard-coding it into the module. It makes it portable in my scenario and allows me to gracefully move from a development environment to production with little or not module modifications.

 
New Post
5/13/2007 12:48 PM
 

You mean another dbms like oracle or mysql?
Sure you can build in everything in your modules what asp.net allows but you must ask yourself if it's sensible or / and regarding efficency.

 
New Post
5/13/2007 1:19 PM
 

There is not an "official way" for a SECOND connection string to connect to a database other than the main DotNetNuke database. there IS an "official way" for connecting to the main DotNetNuke database.

However, I think there is a "recommended way" of adding a second connection in this document:

Data Access Guidelines



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
5/15/2007 10:27 PM
 

Hi Michael, I found nothing concerning a second connection string in this document. Thanks for taking the time thou. I'm really struggling in my module development. Mainly because I must create an interface to connect to a seperate database.  I have gone thru every tutorial you have (and I am greatful for them) but still haven't achieved success in creating a module based upon my data.

I recall you stating in your blog at the beginning of the year concerning your dedication to the beginner and I want to thank and commend you for your efforts.  Have you ever thought of making a tutorial based on a ficticious business model using the Northwind Database?  It would be a great benefit to those of us struggling to create a DNN interface based on an external database. It contains stored procedures, would allow the creation of View and Edit modules that would allow us (have to say, me)  to better understand module navigation, passing parameters from one control to the next, taking advantage of a second connection string in the web.config, etc.

That would be an awesome addition to your already extensive library of DNN tutorials.

 
New Post
5/15/2007 11:08 PM
 

PaskettJ wrote

... I must create an interface to connect to a seperate database.

You can consider storing the connection string in the module setting.  This approach has many advantages:

1.  Each module instance can have it's own database.

2.  All the plumbing to store/retrieve the module settings are already built in.

3.  You don't need to worry about carrying over your web.config settings when upgrading DNN.

4.  If you implement iPortable interface, the module settings (and your connection string) can be easily exported and imported to a new portal.

5.  You can still use your drag and drop VS design method, but substitute the connection string at runtime from the module setting.

6.  If you are security minded, you can encrypt the values before saving.

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Connecting your DotNetNuke® Module to another databaseConnecting your DotNetNuke® Module to another 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