I have two connection strings in my VS 2005 web.config file. I want to always use the first connection string UNLESS that server is down (aka: a connection cannot be made to the first connection string).. If this happens, I want to automatically redirect all web site traffic to the back up server, which is the second connection string. How do I code this bypass/failsafe into my web.config file?
<add name="Connection1" connectionString="Data Source=220.127.116.11;Initial Catalog=Catalog1;User ID=xxxx;Password=xxxx; MultipleActiveResultSets=True; connection timeout=360;" providerName="System.Data.SqlClient"/>
<add name="Connection2BACKUP" connectionString="Data Source=18.104.22.168;Initial Catalog=Catalog2;User ID=xxxx;Password=xxxx; connection timeout=360;" providerName="System.Data.SqlClient"/>