Connection string USING Application Intent errors
Asked Answered
W

3

5

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
Wayzgoose answered 17/1, 2014 at 16:5 Comment(4)
NOt Sure But i have use before is (Info=False;Mode=Read) Rather than (Application Intent=ReadOnly) give it a try if that's help...:)Alcaide
You need to make sure you have all updates installed. That connection string attribute isn't understood by the RTM versions of some of the components you are using.Saporific
@Ikiet, it errors, but even if it worked, it probably wouldn't have triggered the behavior we're aiming at on the HA listener - namely to "load balance" the connection to a readable replica, different than the primary. FYI, the error is ERROR: System.ArgumentException: Keyword not supported: 'info'.Wayzgoose
First, show us your actual code.Harris
W
9

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)

Wayzgoose answered 17/1, 2014 at 16:40 Comment(0)
S
1

Depending on the SNAC protocol you are using there is a slight variation in the application intent connection string property.

When using SQL Native Access Client SQL OLE DB, the application intent connection string should be specified with a space: 'Application Intent'

When connecting using SQLClient or ODBC specify 'ApplicationIntent' with no space

Spindell answered 1/9, 2015 at 16:51 Comment(0)
J
0

For DBeaver Users:

Connection Settings -> Driver Properties -> Advanced driver Properties (At Bottom) ApplicationIntent=ReadOnly

https://mcmap.net/q/2030843/-sql-server-quot-application-intent-readonly-quot-not-working-jdbc

Jerol answered 4/11 at 11:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.