Question

We have a SQL Server configured for mirroring. The initial server failed today and almost all our applications failed over correctly except for a VB.NET application.

When it starts up to set the connection string I get the following error:

"Keyword not supported: 'failover partner:sql-failover;initial catalog'."

Here is the code to connect:

    Dim sConnectionString As String
    Dim sServer As String

    Try
        'Always connect to production server to get startup environment variables
        If gbIsProduction Then
            If gsProductionServer = "" Then
                sServer = "PROD-SQL"
            Else : sServer = gsProductionServer
            End If
        Else : sServer = gsDevelopmentServer
        End If
        sConnectionString = "Data Source=" & sServer & ";Failover Partner:SQL-FAILOVER;Initial Catalog=*****;User ID=****;Password=******;"
        cnSystem.ConnectionString = sConnectionString
        cnSystem.Open()
        cmdSystem.Connection = cnSystem
    Catch ex As Exception
        RaiseError("", "modGeneral." & System.Reflection.MethodBase.GetCurrentMethod().Name, Err.Number, Err.Description)

Any reason why? I know Failover Partner is not supported in .NET 1.1 but I am using framework 3.5 SP1.

Thanks!

Was it helpful?

Solution

This part of the connection string is wrong

....;Failover Partner:SQL-FAILOVER;.....

should be

....;Failover Partner=SQL-FAILOVER;......
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top