How to get Connection String ?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 5 años
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;
Hace 5 años
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
Hace 5 años
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??
Hace 5 años
latest one.. I think 4.1... (asp
net core 2.1)
Hace 5 años
Hello,

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




using Nop.Core.Data;

var dataSettings = DataSettingsManager.LoadSettings();




Hace 2 años
Hi guys,
for the junior developers like myself who are using nopCommerce version 4.3 to find out what ConnectionSring you're using, if you'are using Visual Studio 2019, simply find the DataSettings class by searching for DataSettings.cs inside the search box.
Within this class try to find the ConnectionString property(which is named ConnectionString) and make a breakpoint on this property. once you run the project with the debugger if you move the cursor on the property the ConnectionString will be shown.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.