Keyword not supported: 'failover partner:sql-failover;initial catalog' in VB.NET
-
24-06-2021 - |
Pergunta
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!
Solução
This part of the connection string is wrong
....;Failover Partner:SQL-FAILOVER;.....
should be
....;Failover Partner=SQL-FAILOVER;......
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow