Is it possible to insert a connection string into a web.config file at runtime, if it isn't there? Would this work?
The connection string is for a ASP.NET user login and create account database.
Is it possible to insert a connection string into a web.config file at runtime, if it isn't there? Would this work?
The connection string is for a ASP.NET user login and create account database.
How do you mean "insert?" If you mean can you manually edit web.config: yes, you can. You'd add an entry for connectionStrings (if there wasn't one) an then a child node for your specific connectionString.
If you mean can you do it in code: theoretically yes. However, it is normally bad practice, and a pain the rear.
Yes it is very possible:
<connectionStrings>
<add name="yourNameHere" connectionString="connectiongStringHere" providerName="nameHere"/>
</connectionStrings>
inside ConfigSections