0

We use the following services, which are declared in the Web.config.

  • AspNetSqlMembershipProvider
  • AspNetSqlProfileProvider
  • AspNetSqlRoleProvider

We are using EntityFramework, and now have a requirement to programmatically set the connection string (it is fetched from the deployment environment, so Web.config cannot be used).

The question is, how can we continue to use these Providers, but have a programatic connection string?

We do not want to maintain multiple configs, and we do not want to leave credentials in the Web.config.

Thanks!

yano
  • 4,095
  • 3
  • 35
  • 68
  • possible duplicate of [How do I set a connection string config programatically in .net?](http://stackoverflow.com/questions/360024/how-do-i-set-a-connection-string-config-programatically-in-net) – yano Apr 15 '14 at 01:25
  • Workaround is this! http://stackoverflow.com/questions/360024/how-do-i-set-a-connection-string-config-programatically-in-net – yano Apr 15 '14 at 01:26

0 Answers0