LexByte
LexByte

Reputation: 412

How do i connect to a given ip from database with specified name , password, and port

Like the title says. I have to connect to a database with some IP address, port , login name and login password.

I tried using the Server Explorer in the Visual studio 2015. The problem i have is that don't know how to add the port number in the connection. Shall the port number be added like ip:port or ip,port in the server name tab of Visual Server Explorer?

Also is there anyway to do this in the connectionStrings tag of WebConfig?

<connectionStrings>
    <add name="ConnectionName1" connectionString="DataSource=xxx.xxx.xxx.xx:xxxx"/>
</connectionStrings>

Upvotes: 0

Views: 188

Answers (1)

James Z
James Z

Reputation: 12317

SQL Server uses comma as the port separator for connections, for example:

DataSource=xxx.xxx.xxx.xx,xxxx

You can see more examples here

Upvotes: 2

Related Questions