I have a question about how correct method to access external DB with C#(Extension) thru VPN.  

Currently, I stored the connection string inside the code.  I know this is wrong but I just not sure/don't know what is the proper way to doing it.  I know we can add database connection(s) at Service Center/Administration.  So is there anyway I could use this setting inside my C# code?

Any help will be much appreciated.



Hi williamW,

You could keep the setting outside your extension, and then could create a connect() configin your extension, with the connetion string as input.

Then make a blank module that wraps the config action of your extension and have a site property for the connection string.

This way you also ensured you can easily change the connection string per environment.




Hi Daniel,

About the Site Property...where is it located?  For a web app, I understand it must be stored in Server Site.  But how about Mobile App?  It is hard to imagine I store the connection string inside Mobile and pass it through internet to my extension to call the database even if this is in https.



I have studied some db connection plugins at Forge.  Now I know how to access data connection setup at Service Center.  Problem solved for now.  But still, does Site property stick with a mobile app on deployment?