DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Pulling data from a second database

 7 Replies
 1 Subscribed to this topic
 40 Subscribed to this forum
Sort:
Author
Messages
Growing Member
Posts: 37
Growing Member

I have a website built on DNN.

There is a separate private database (that needs to remain separate) on mySQL that has some tables I would like to access and display data from.

Is there a way to do this within web.config?  Or another way to pull from a separate database without showing the username and password or access string within the View Source..?


Maybe it has to be built separately and loaded into an iFrame?

Veteran Member
Posts: 1182
Veteran Member
MVP
MVP
You're an MVP!
You could have a look at the DNN Reports module:
https://github.com/DNNCom...ity/DNN.Reports/wiki

Happy DNNing!
Michael

Michael Tobisch
DNN★MVP

DNN Connect
Senior Member
Posts: 1322
Senior Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
Lifesaver
Lifesaver
You're Life Saver!
New Poster
New Poster
Congrats on posting!
3 Engaged Reader
Engaged Reader
You are an engaged reader!
Posted By TechieMD on 17 Jul 2020 10:11 PM

I have a website built on DNN.

There is a separate private database (that needs to remain separate) on mySQL that has some tables I would like to access and display data from.

Is there a way to do this within web.config?  Or another way to pull from a separate database without showing the username and password or access string within the View Source..?


Maybe it has to be built separately and loaded into an iFrame?

I think you need some kind of mySQL connector.
In that case you can also add the querystring to the web.config AFAIK.

 

 

Growing Member
Posts: 80
Growing Member

There are a few modules that can connect to another database,
-The Reports module is my recommendation as well.
-Live Tabs from Mandeeps.com
-Live Forms from Mandeeps.com
-XMod Pro from DNNDev.com
-digForm from dignuke.com
-more...

Here are some additional links for you interacting with the web.config
-https://www.dnnsoftware.c...se-using-the-dnn-dal
-https://www.dnnhero.com/F...adid/547/scope/posts
-https://www.dnnsoftware.c...h-multiple-databases
-https://dnncommunity.org/forums/aft/201
There are more links like this as well...

Veteran Member
Posts: 1246
Veteran Member
MVP
MVP
You're an MVP!
I assume that you will build a custom module to access the data.

First, add a connection string to web.config.

Then, in your module you can use any of the "standard" methods to access data from the second database: DAL, DAL2, or a SQL Adapter. The extra connection string is used to tell any of these methods how to connect to the second database.

Another attractive alternative is the 2sxc module. It has built-in methods to connect to SQL databases, too. This may provide some hints: https://2sxc.org/en/Docs/Feature/feature/2579
Growing Member
Posts: 37
Growing Member
Thanks everyone for the replies.
Looking into reports model. 2sxc looks interesting too but nervous to incorporate something that isn't part of core DNN
Veteran Member
Posts: 1246
Veteran Member
MVP
MVP
You're an MVP!
Please don't take this negatively, but as encouragement ...

Given that the only modules in "core DNN" are the HTML and Razor modules, that doesn't leave you much. The Reports module that you mention is not part of the core.

I'd encourage you do expand the horizon a bit an explore the world of modules and other extensions that add flexibility, power, features, etc. to the framework that is DNN. And it's really only a framework, not terribly useful without modules. And there are some very good ones! That includes open source modules maintained by the DNN Community, other open source modules maintained by others, and commercial modules. All have their place, and I wouldn't shrink from using any of them.
Growing Member
Posts: 80
Growing Member
Joe is right. (As always) Modules are good for you. :)

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

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

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. 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.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved