By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,659 Members | 1,957 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,659 IT Pros & Developers. It's quick & easy.

What is the format of a SQLConnection connection string?

P: 68
What is the format of a SQLConnection connection string that is passed in the constructor method? I have run a search engine search online and all I could find so far is examples like:

Expand|Select|Wrap|Line Numbers
  1.  "Data Source=(local);Initial Catalog=AdventureWorks; Integrated Security=SSPI;";

Expand|Select|Wrap|Line Numbers
  1.  "User Id=sa;Server=localhost;Initial Catalog=Test;"
The examples raises questions. Since the SQL Server Management Studio (SSMS) program offers a different set of fields during start up in order to connect to a database, I have to ask how does "Server type, "Server name", "Authentication", "User name" and "Password". Also, is "Catalog" another name for a database table?
Jul 9 '18 #1
Share this Question
Share on Google+
1 Reply

P: 10
If you want to connect local Database then use below code.
Data Source='server name';Initial Catalog='your db name';Integrated Security=True
Dec 11 '18 #2

Post your reply

Sign in to post your reply or Sign up for a free account.