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


using Nop.Core.Data;


in your using declarations.
11 years ago
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
11 years ago
BusinessLogic?

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