I have an ASP.NET site using LINQ to SQL set up with multiple databases (by changing the Source for the tables on the other/”secondary” server). As seen here.
How do I set up a Failover Partner for this? I have it set up in the connection string, but I had to hardcode the Source with the server name, so that doesn’t work.
The best method I could find/come up with was to create two LINQ External Mappings. On startup, I check to see if the main server is running using the main Mapping. If it’s not, I set my connections to use the second LINQ mapping that has the FailOver database: