Change connection on the fly
Posted
by aron
on Stack Overflow
See other posts from Stack Overflow
or by aron
Published on 2010-05-10T15:21:33Z
Indexed on
2010/05/10
15:24 UTC
Read the original article
Hit count: 271
Hello, I have a SQL server with 50 databases. Each one has the exact same schema. I used the awesome Subsonic 2.2 create the DAL based on one of them.
I need to loop though a list of database names and connect to each one and perform an update one at a time.
If there a way to alter how subsonic uses the connection string. I believe I would need to store the connection string in memory that way it can keep changing.
Is this possible?
I tried doing a
ConfigurationManager.ConnectionStrings["theConnStrName"].ConnectionString = updated-connection-string-here;
.. but that did not work
thanks!
© Stack Overflow or respective owner