sql-serversql-server-2012connection-stringhigh-availability

Connection string USING Application Intent errors


Trying to create a "read only" intent connection string against SQL Server 2012 high availability Group, following this article, I am getting:

System.ArgumentException: Keyword not supported: 'application intent'. at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)

This is on a Windows 7 Pro machine, going against high availability group based on SQL Server 2012 (which has been confirmed to work with "-ReadOnly" parameter).

There are two MS KB articles about hotfixes that introduce "Application Intent", but they are for Framework versions 3.5 and 4. I am not finding anything for 4.5, so I assume support is included. Both 4.5 and SQL Server Native Client should support it out-of-the-box.

We are using 4.5.

This is the connection string:

Data Source=HAListener;Initial Catalog=*********;User ID=************;Password=********; Application Intent=ReadOnly

Anybody encountered this error?

SOLVED There shouldn't be any space in Application Intent:

ApplicationIntent=ReadOnly

Solution

  • I guess I'll post the solution in case someone else encounters the same issue:

    there is no space between Application and Intent. the correct parameter is:

    ApplicationIntent=ReadOnly
    

    (reference: MSDN)