Extension and db connection string

Hi,


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.

William

mvp_badge
MVP
Solution

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.

Regards,

Daniel


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.


Best,

William 

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?


William

WilliamW wrote:

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?


William

 Sorry to break this thread open , but could you hint me in the direction of the Forge plugins you found?
Looking for the same thing: how to get to the configured Logical database Connector in the C# extention code, for the prupose of calling an external procedure in an external system.

 


Hi William,


Did the work is finish using c# , Actually I am also looking for the same and I need to call stored procedure from c# code and I need to pass that output to service studio , Anybody please help me on this.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.