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.
Hace 11 años
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
Hace 11 años
https://www.nopcommerce.com/boards/t/16608/how-can-i-take-connection-string.aspx
Hace 11 años
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
Hace 11 años
Ensure you have a


using Nop.Core.Data;


in your using declarations.
Hace 11 años
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
Hace 11 años
BusinessLogic?

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