1

I can find dozens of examples of a connectionString entry in Web.config, but there appears to be no comprehensive definition of the values in the string. What do the following mean:

  • Data Source -- This appears to be the server identity, but that could be a misinterpretation
  • Initial Catalog
  • AttachDbFileName -- Seems to be the file name of the DB file, but how does this relate to Initial Catalog? And what does |DataDirectory| mean when included in the name?
  • Integrated Security -- I assume that "True" means that "Windows Authentication" is used vs "SQL Server Authentication", but that's only a guess.
  • UserID/Password -- Used only in a few odd examples. Not clear when these might/might not be needed.
  • server -- I see this in some rare examples -- how different from Data Source?
  • database -- Ditto.
  • MultipleActiveResultSets -- ??

2 Answers 2

1

That's all documented right here on MSDN.

  • DataSource: The name or network address of the instance of SQL Server to which to connect.
  • Intial Catalog: The name of the database that will be in scope when connecting.
  • AttachDbFileName: he name of the primary database file, including the full path name of an attachable database. AttachDBFilename is only supported for primary data files with an .mdf extension.
  • Integrated Security: When false, User ID and Password are specified in the connection. When true, the current Windows account credentials are used for authentication.
  • User ID / Pasword: Used for SQL authentication.
  • Server: Similar purpose as DataSource, but appears to support different syntaxs depending on your needs.
  • MultipleActiveResultSets: When true, an application can maintain multiple active result sets (MARS). When false, an application must process or cancel all result sets from one batch before it can execute any other batch on that connection.

There is a lot more detail on each of these in the documentation.

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah, I spent literally hours looking for something like that. Was finally directed to it (indirectly) about 20 minutes ago by a co-worker I'd queried by email. He also (indirectly) directed me to this, which is a little less formal but with a lot of good details. Neither is entirely satisfying, but probably the best one can hope for from MS.
1

You can also refer to the site http://www.connectionstrings.com

It is a great resource when it comes to play with connection strings for various database systems

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.