EntLib 3.1 DAAB Failover Partner ASP.Net

Topics: Data Access Application Block, General discussion
Jul 2, 2008 at 4:03 PM
I've been searching everywhere trying to find out how exactly to configure my connection string to take advantage of SQL 2005 mirroring and failover. Can somebody please tell me what I'm missing or doing wrong; when I stop 'db1' the web app just reports a connection error with the primary data source.

Here is what I have in my web.config:

<connectionStrings>
 <add name="MyDB" connectionString="Data Source=db1;Failover Partner=db2;Initial Catalog=XYZ;User ID=somebody;Password=something" providerName="System.Data.SqlClient"/>
</connectionStrings>

 

 

Jul 2, 2008 at 5:02 PM
That connection string looks fine according to the docs. Have you tried with a plain ADO.NET connection to determine whether the mechanism works?


buster wrote:
I've been searching everywhere trying to find out how exactly to configure my connection string to take advantage of SQL 2005 mirroring and failover. Can somebody please tell me what I'm missing or doing wrong; when I stop 'db1' the web app just reports a connection error with the primary data source.

Here is what I have in my web.config:

<connectionStrings>
 <add name="MyDB" connectionString="Data Source=db1;Failover Partner=db2;Initial Catalog=XYZ;User ID=somebody;Password=something" providerName="System.Data.SqlClient"/>
</connectionStrings>

 

 

 




Jul 2, 2008 at 5:35 PM
sorry to bother anyone, actually the connection is correct and it is working. i discovered the site had a 3rd party sub-app running and that's actually where the connection was failing (due to not having the 'failover partner' parameter in it's connection string.

please close this thread.