? orus casino? bodog? ruleta? luckia? betano? sportium? spin casino? stakes? 3 reyes? 888? lottoland? coolbet? 777 casino? gana777? betfair? bwin? yak casino? ivy casino? oddschecker? red casino? netbet? william hill? vip casino? rey casino? marathonbet? dafabet? sol casino? 1bet? winland? bet777? parimatch? 18bet? 888casino? campobet? mostbet? ganabet? rushbet? betcris? betsson? lucky? novibet? winner? winpot? betmaster? betmexico? cancun? playcity? strendus? pokerstars? codere? caliente? fun88? bbrbet? 1win? 10bet? betway? pin up? spinbet? 7cslot? pickwin? spin bet? mr fortune? w88? pragmatic? gamdom? crasher? jojobet? betmex? bcasino? foliatti? winner mx? bets 10? big bola? bet master? inbet? 7slots? lucky day? m777? mexplay? luckydays? bet caliente? 1x? plinko

Forum


HomeHomePremiumPremiumDevelopmentDevelopmentquerying data from external databasequerying data from external database
Previous
 
Next
New Post
7/24/2015 8:43 AM
 

I'm developing a custom module which will query data from external database not the CMS one so where should I put the connection string in the module project (christoc template) 

I understand that I can manually add the connection to Web.config in the website root but I care about the module when you install it i don't want manual steps

 
New Post
7/24/2015 1:40 PM
 

Johnny,

There is a way to use the .dnn manifest file in the module template to install and uninstall an entry in the DNN web.config such that you don't need a manual step when someone installs your module using the packaging.

<component type="Config">
  <config>
    <configfile>web.config</configfile>
    <install>
      <configuration>
        <nodes>
          <node path="/configuration/appSettings" action="update" key="key" collision="overwrite">
            <add key="MyExternalConnection" value="Data Source=.;Initial Catalog=mydata;User ID=user;Password=abc123;">
          </add></node>
        </nodes>
      </configuration>
    </install>
    <uninstall>
      <configuration>
        <nodes>
          <node path="/configuration/appSettings/add[@key='MyExternalConnection']" action="remove">
        </node></nodes>
      </configuration>
    </uninstall>
  </config>
</component>

Then your module can access the connection string using:

DotNetNuke.Common.Utilities.Config.GetSetting("MyExternalConnection");

Another option is to put the connection string in a resource (.resx) file that gets deployed with your module.

 

Hope either of these suggestions works for you.

Scott

 
New Post
7/24/2015 2:05 PM
 

Sounds good I'll try them, appreciate your help thank you

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentquerying data from external databasequerying data from external database



Try FREE
30 days money back guaranteed