C# & ADO.NET

SQL Server connection string builder and checker for ASP.NET

C# & ADO.NET · · Published 2026-11-13 · Updated 2026-11-13

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

Keyword reference

The 43 keywords of Microsoft.Data.SqlClient, with their synonyms and default values. Keywords are not case-sensitive.

KeywordSynonymsDefault
Application IntentApplicationIntentReadWrite
Application Name––
AttachDBFilenameExtended Properties, Initial File Name–
Attestation Protocol–NotSpecified
Authentication––
Column Encryption Setting–disabled
Command Timeout–30
Connect Retry CountConnectRetryCount1
Connect Retry IntervalConnectRetryInterval10
Connect TimeoutConnection Timeout, Timeout15
Current LanguageLanguage–
Data SourceServer, 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 SPNFailoverPartnerSPN–
Host Name In CertificateHostNameInCertificate–
Initial CatalogDatabase–
Integrated SecurityTrusted_Connectionfalse
IP Address PreferenceIPAddressPreferenceIPv4First
Load Balance TimeoutConnection Lifetime0
Max Pool Size–100
Min Pool Size–0
Multi Subnet FailoverMultiSubnetFailovertrue
Multiple Active Result SetsMultipleActiveResultSetsfalse
Network LibraryNetwork, Net–
Packet Size–8000
PasswordPWD–
Persist Security InfoPersistSecurityInfofalse
Pool Blocking PeriodPoolBlockingPeriodAuto
Pooling–true
Replication–false
Server CertificateServerCertificate–
Server SPNServerSPN–
Transaction Binding–Implicit Unbind
Transparent Network IP ResolutionTransparentNetworkIPResolutionfalse (.NET Framework only)
Trust Server CertificateTrustServerCertificatefalse
Type System Version–Latest
User IDUID, User–
User Instance–false
Vector Type SupportVectorTypeSupportv2
Workstation IDWSIDThe 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.