SQL Server connection string builder and checker for ASP.NET
A connection string is a short line of text, but a wrong keyword, a missing quotation mark or a forgotten TrustServerCertificate can stop an application from starting or leave it less secure than intended. This page builds a SqlClient connection string from a few choices and checks one you paste, against the 43 keywords (and 76 accepted spellings) documented for SqlConnection.ConnectionString.
Both tools run entirely in your browser: nothing you type, including a password, leaves the page. For how to store the result and read it from code, see getting the connection string from web.config and appSettings vs connectionStrings.
Build
Choose the server, database and authentication. The string updates as you type, together with a <connectionStrings> entry for web.config and the matching section of appsettings.json, already escaped for XML and JSON. Values that contain a semicolon or a quotation mark are quoted following the documented rules.
Check
The checker splits the string into keyword and value pairs the way SqlClient does, then reports keywords SqlClient does not know (which make new SqlConnection(...) throw an ArgumentException), synonyms, keywords given twice, invalid boolean values, and settings worth a second look. Choose the provider in the builder above: the older System.Data.SqlClient of .NET Framework does not encrypt by default and does not know the newest keywords.
What the warnings mean
- Encrypt and Trust Server Certificate. Since Microsoft.Data.SqlClient 4.0,
Encryptdefaults totrue; a server with a self-signed certificate then fails with a certificate error. SettingTrustServerCertificate=Truemakes the error go away by skipping validation, which is acceptable on a developer machine but not in production. Install a trusted certificate on the server instead.Encrypt=Strict(version 5.0 and later) uses TDS 8.0 and ignores TrustServerCertificate. - Passwords. Microsoft's documentation marks
User IDandPasswordas "not recommended" and points to Windows (Integrated Security) or Microsoft Entra ID authentication. If you must use a SQL login, keep the string out of source control and leavePersist Security Infoatfalse. - Integrated Security with a password. When Integrated Security is true, any User ID and Password in the string are ignored.
- Azure SQL Database. Microsoft recommends a 30-second connect timeout instead of the default 15.
Keyword reference
The 43 keywords of Microsoft.Data.SqlClient, with their synonyms and default values. Keywords are not case-sensitive.
| Keyword | Synonyms | Default |
|---|---|---|
Application Intent | ApplicationIntent | ReadWrite |
Application Name | – | – |
AttachDBFilename | Extended Properties, Initial File Name | – |
Attestation Protocol | – | NotSpecified |
Authentication | – | – |
Column Encryption Setting | – | disabled |
Command Timeout | – | 30 |
Connect Retry Count | ConnectRetryCount | 1 |
Connect Retry Interval | ConnectRetryInterval | 10 |
Connect Timeout | Connection Timeout, Timeout | 15 |
Current Language | Language | – |
Data Source | Server, Address, Addr, Network Address | – |
Enclave Attestation Url | – | – |
Encrypt | – | true in 4.0 and above false in 3.x and below |
Enlist | – | true |
Failover Partner | – | – |
Failover Partner SPN | FailoverPartnerSPN | – |
Host Name In Certificate | HostNameInCertificate | – |
Initial Catalog | Database | – |
Integrated Security | Trusted_Connection | false |
IP Address Preference | IPAddressPreference | IPv4First |
Load Balance Timeout | Connection Lifetime | 0 |
Max Pool Size | – | 100 |
Min Pool Size | – | 0 |
Multi Subnet Failover | MultiSubnetFailover | true |
Multiple Active Result Sets | MultipleActiveResultSets | false |
Network Library | Network, Net | – |
Packet Size | – | 8000 |
Password | PWD | – |
Persist Security Info | PersistSecurityInfo | false |
Pool Blocking Period | PoolBlockingPeriod | Auto |
Pooling | – | true |
Replication | – | false |
Server Certificate | ServerCertificate | – |
Server SPN | ServerSPN | – |
Transaction Binding | – | Implicit Unbind |
Transparent Network IP Resolution | TransparentNetworkIPResolution | false (.NET Framework only) |
Trust Server Certificate | TrustServerCertificate | false |
Type System Version | – | Latest |
User ID | UID, User | – |
User Instance | – | false |
Vector Type Support | VectorTypeSupport | v2 |
Workstation ID | WSID | The local computer name |
Method, sources and licence
Source. The keyword list, synonyms, default values, accepted values of Authentication, Encrypt and the boolean keywords, and the quoting rules come from the reference documentation of SqlConnection.ConnectionString in the Microsoft.Data.SqlClient repository (file SqlConnection.xml in the doc/snippets folder, main branch, read on 13 November 2026), published by Microsoft as SqlConnection.ConnectionString; see also Connection string syntax. 43 keywords, 76 accepted names including synonyms.
What the tools do not check. They do not contact any server, so they cannot tell whether a server name resolves, a login exists or a certificate is trusted. The list of keywords that System.Data.SqlClient does not accept is limited to the newest security and network keywords (Host Name In Certificate, Server Certificate, IP Address Preference, Vector Type Support, Server SPN, Failover Partner SPN, Attestation Protocol); other differences between provider versions are not checked. The rule that a repeated keyword takes its last value follows SqlClient's parser behaviour.
Licence. The SqlClient repository is published by the .NET Foundation under the MIT licence. The tools and their texts are original work of Postback Notes; nothing you type is stored or sent.