0

My requirement is User can create register with us, on successful registration we are providing them with the database on their name to access their subdomain. We are saving their details in our database.

During deployement I want to change the connection string name with their database name so that they can use their subdomain. how can i do tis??

My Project Web config file will have connectionstring like this

add name="Connectionstring" connectionstring="".

how can i change the name="connectionstring" dynamically with database name in webconfig as well as in every codebehind page ConfigurationManager.ConnectionStrings["ConnectionString"].

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
user3226735
  • 11
  • 1
  • 4
  • possible duplicate of [How do you modify the web.config appSettings at runtime?](http://stackoverflow.com/questions/719928/how-do-you-modify-the-web-config-appsettings-at-runtime) (or maybe not, I'm not sure I understand the question) – Alex Jan 23 '14 at 08:37

1 Answers1

0

Dynamic modification ( at runtime ) of the web.config file is not possible another master database would be required that would Map the user or sub domain to a database and connection string.

Mike Beeler
  • 4,081
  • 2
  • 29
  • 44