How to get Connection String ?

Posted: September 05, 2018 at 1:07 AM Quote #211525
This code is not working anymore.

https://www.nopcommerce.com/boards/t/18539/how-to-get-connection-string-from-_context-in-my-code.aspx

var connectionString = new DataSettingsManager().LoadSettings().DataConnectionString;
This post/answer is useful
1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: September 05, 2018 at 1:37 AM Quote #211527
Hi,

I can help.

You can reach me on Skype: cisin.justin or Email: [email protected] so that we can discuss this further.



Justin
+14074139057
This post/answer is useful
-4
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: September 06, 2018 at 9:07 AM Quote #211614
ritwickdey wrote:
This code is not working anymore.

https://www.nopcommerce.com/boards/t/18539/how-to-get-connection-string-from-_context-in-my-code.aspx

var connectionString = new DataSettingsManager().LoadSettings().DataConnectionString;
.


May I know which version of Nopcommerce are you using??
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Please up-vote the answer, if it helpful to you! :)

Cheers,
sk5202
Posted: September 06, 2018 at 9:09 AM Quote #211615
latest one.. I think 4.1... (asp
net core 2.1)
This post/answer is useful
-1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: September 06, 2018 at 12:14 PM Quote #211620
Hello,

You can use below code to get connection string in 4.10.




using Nop.Core.Data;

var dataSettings = DataSettingsManager.LoadSettings();




This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Please up-vote the answer, if it helpful to you! :)

Cheers,
sk5202
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.