How to get connection string from _context in my code

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Il y a 11 ans
Hi,
  I am getting the connection string value from _context in c# code as below

System.Data.EntityClient.EntityConnection c = (System.Data.EntityClient.EntityConnection)_context.Connection;              
String EntityConnectionString = c.StoreConnection.ConnectionString;


Now when i run first time its working fine. But again when the same event is clicked in this connection string the Password value is missing and so i am not able to connect the sql server.

Anyone help me in this

thanks
Rajee
Il y a 11 ans
https://www.nopcommerce.com/boards/t/16608/how-can-i-take-connection-string.aspx
Il y a 11 ans
Hi,
  i am not able to use

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


It says "The type or namespace name 'DataSettingsManager' could not be found"

thanks
Rajee
Il y a 11 ans
Ensure you have a


using Nop.Core.Data;


in your using declarations.
Il y a 11 ans
Hi,
  fyi: i have made some modifications in nopcommerce source code and i have only businesslogic and common projects.
  I have removed other projects.
  I am not able to get nop.core.data namespace in my code.
  Where is the problem?

thanks
Rajee
Il y a 11 ans
BusinessLogic?

What version of nopcommerce are we talking about?
Il y a 11 ans
Hi,
Sorry for not mentioning the version number. I am using 1.9
Il y a 11 ans
Hi,
Any one can solve my problem?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.