【问题标题】:Keyword not supported: 'failover partner:sql-failover;initial catalog' in VB.NET不支持关键字:VB.NET 中的“故障转移伙伴:sql-failover;初始目录”
【发布时间】:2012-08-03 13:18:57
【问题描述】:

我们有一个为镜像配置的 SQL Server。今天最初的服务器出现故障,我们几乎所有的应用程序都正确故障转移,除了一个 VB.NET 应用程序。

当它启动设置连接字符串时,我收到以下错误:

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

这里是连接代码:

    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)

有什么理由吗?我知道 .NET 1.1 不支持故障转移合作伙伴,但我使用的是 framework 3.5 SP1。

谢谢!

【问题讨论】:

    标签: vb.net sql-server-2008-r2 mirroring


    【解决方案1】:

    这部分连接字符串是错误的

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

    应该是

    ....;Failover Partner=SQL-FAILOVER;......
    

    【讨论】:

    • 是的,我刚看到,谢谢。现在连接字符串得到了正确验证,但它没有转移到故障转移服务器。是否必须与初始服务器建立一次成功连接才能进行故障转移?
    猜你喜欢
    • 1970-01-01
    • 2015-10-28
    • 2010-10-09
    • 2011-11-08
    • 1970-01-01
    • 1970-01-01
    • 2011-10-15
    • 2010-10-15
    • 1970-01-01
    相关资源
    最近更新 更多