• Login
  • Register

DNN Forums

A community discussion page. We're starting from scratch, so...let's get the party started!

Pulling data from a second database

You are not authorized to post a reply.
Sort:


New Member


Posts:21
New 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:353
    Veteran Member

      You could have a look at the DNN Reports module:
      https://github.com/DNNCommunity/DNN.Reports/wiki

      Happy DNNing!
      Michael

      Michael Tobisch
      DNN★MVP

      dnnWerk Austria
      DNN Usergroup für den deutschsprachigen Raum
      DNN Connect


      Veteran Member


      Posts:596
      Veteran Member

        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.

         

         



        Basic Member


        Posts:45
        Basic 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.com/forums/threadid/257343/scope/posts/tip-how-to-connect-to-another-database-using-the-dnn-dal
          -https://www.dnnhero.com/Forum/forumid/6/threadid/547/scope/posts
          -https://www.dnnsoftware.com/forums/threadid/121219/scope/posts/working-with-multiple-databases
          -https://dnncommunity.org/forums/aft/201
          There are more links like this as well...



          Veteran Member


          Posts:546
          Veteran Member

            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
            Joe Craig
            DNN MVP
            Patapsco Research Group


            New Member


            Posts:21
            New 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:546
              Veteran Member

                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.
                Joe Craig
                DNN MVP
                Patapsco Research Group


                Basic Member


                Posts:45
                Basic Member

                  Joe is right. (As always) Modules are good for you. :)
                  You are not authorized to post a reply.

                  These Forums are dedicated to discussion of DNN Platform.

                  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.

                  Would you like to help us?

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

                  Get Involved