At the moment I have the following <connectionStrings> definition in my Web.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 didn’t write this though, so I have a feeling that it was automatically created by Visual Studio.
My database is hosted on a separate server on our network, so how do I define it and the database username and password?
For the sake of the example, the server information and credentials are:
Server address: sql-database / 10.0.0.11
Username: myUsername
Password: myPassword
Server Name:
IP-Address\Database-instance,PortYou can not directly. you need to have
TCP/IPenabled and configured theTCP/IP Portson sql server configuration manager at remote server.Go through it: Configurations-Remote-Server
Or if it already configured then just contact
DBAfor the hosted server for providing the proper connection string.you need to have TCP/IP connectivity .Just launch it, enter the DNS host name or IP address in the
Server Name'box and hit Connect. The hosting company needs to have enabling TCP/IP on your SQL Server instance, and them providing you with secure access to the IP address that instance is running on.Then it would be in this form:
Most administrators do not allow direct access to the SQL Server from outside the firewall. In that case, if you can connect to the host over VPN then you should be able to connect directly to the server with Enterprise Manager or SQL Management Studio.