question

dutchpolitician avatar image
dutchpolitician asked

Newbie Question about Connection Strings

Hello!

Professionally I have a non-technical background and am just getting started with databases and SQL Server, so please bear with me.

I've come across this term called "connection string". What it does is connect an application to a database. In order to do that, one has to type in a connection string within the application. Is that correct?

Also, can I connect to a database from another (client) computer by running a connection string? If yes, how do I do that?

I already have a test database that I created in SQL Server Management Studio and was able to connect to it from another computer using Ethernet cable. I went through all these procedures of enabling TCP/IP and altering my Firewall's rules, so I'm just wondering if I could have done it through a connection string.

Thank you!

connection-stringconnection string
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
KenJ avatar image
KenJ answered

The connection string is the metadata that SQL Server Management Studio (SSMS) and other applications use behind the scenes to connect to the database.

When you connect with SSMS, the information you supply in the connection dialog window is used to generate a query string - you specify the server and database to which you want to connect then supply your credentials in the form of username and password or windows authentication.

SSMS will then place those values into a connection string like this:

Server=<your_server_name>;Database=<your_database_name>;User Id=<your_username>;Password=<your_password>;

Rather than being one of the physical network components you mentioned, the connection string becomes part of the traffic that traverses the network - often via TCP/IP.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.