ConnectionString Definition for Remote SQL Server

I currently have the following <connectionStrings> definition in myWeb.config` file :

  <connectionStrings>
    <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
  </connectionStrings>

I did not write this, so I have the feeling that it was automatically created by Visual Studio.

My database is hosted on a separate server on our network, so how do I determine it and the database username and password?

For example, information and server credentials:

Server Address: sql-database / 10.0.0.11

Username: myUsername

Password: myPassword

+5
source share
3 answers

Server name: IP-Address\Database-instance,Port

You cannot directly. You need to enable TCP/IPand configure Configuration Manager TCP/IP Portson SQL Server on the remote server.

: -

, , DBA .

TCP/IP. , DNS IP- Server Name' "". TCP/IP SQL Server IP-, .

:

connectionString="Data Source=Server_Name;Initial Catalog=Database_Name;
User ID=XXXX;Password=XXXX;Integrated Security=True;"
providerName="Provider_Name"

SQL Server . , VPN, Enterprise Manager SQL Management Studio.

+4

connectionString = "data source=sql-database / 10.0.0.11; User ID = myUsername; PassWord = your password "
+1

Try using a connection string in this format

<connectionStrings>
<add name="SQLconnString" connectionString="Data Source=246.185.231.253;Initial Catalog=DNAME;User ID=SampleUID;Password=SamplePWD;timeout=6000" />
</connectionStrings>

It will help you!

+1
source

All Articles