SQL connection string

the website should go live, which I have hosted on the client server. I have all permissions for the IIS.in web.config file. I also provided the SQL connection string as:

<appSettings>
<add key="ConnectionString" value="Data Source=USER\SQLEXPRESS;Initial Catalog=people_metrix;User ID=MyUser;Password=abc123"/>  </appSettings>

      

Remote connections (TCP / IP and Named Pipes) are allowed in sql server 2005.
but i cant login to webasite. The database has a username and password.

The server has a firewall turned on and no IP address (automatically obtains an IP address). Log in for other reasons?

0


source to share


2 answers


Please do not use "sa" in the connection string. EVER!

First try connecting using SQL Server Management Studio with your connection string credentials (not sa!).

Does the firewall on the SQl sServer machine provide traffic to port 1433?

To allow connections to SQL Server over TCP port, follow these steps.



  • Click Start | Control Panel | Network connections
  • Right click on the network adapter serving inbound connections to SQL Server and select Properties
  • Select Advanced | Windows Firewall | Settings
  • Select Exceptions | Add port
  • In the Name field, enter SQL Server and select Port Number 1433. Use TCP as the protocol.
  • Click "OK" to close all dialogs.

If you are using something other than standard TCP / IP to access SQL Server, you need to enable different ports. To allow RPC over named pipes instead of TCP, open port 445 in the same way as described above.

See this MS support article for configuring remote connections: How to configure SQL Server 2005 to allow remote connections

+1


source


You can check connectionstrings.com



It has some examples of connection strings.

0


source







All Articles