1

I just deployed my database to my remote server. I am trying to create a connectionstring to the remote server and it won't work. I am using godaddy. I kept having this message: could not establish a connection to the database. Here is the connectionstring for the local server:

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

Can someone help me with the connection for the remote server? Lets say my database name is collins and my password is database, and the remote hosting server=quiz.db.4423045.hostedresource.com;

2 Answers 2

1

Given those connection elements you mention, your connection string ought to look something like this:

<add name="RemoteConnectionString" 
     connectionString="server=quiz.db.4423045.hostedresource.com;database=collins;
                       user id=?????;password=database;"
     providerName="System.Data.SqlClient" />

What you're missing is a user name for the connection to the database (or you didn't specify one) - you need to place that into the connection string as value for the user id= attribute.

For a great listing and explanations of all things about connection strings, you should definitely check out http://www.connectionstrings.com

Sign up to request clarification or add additional context in comments.

Comments

0

First I would check that you can access ports TCP 1433 and UDP 1434 on that server (you need also the UDP port since you are using the SQLEXPRESS instance in the server).

You can check that using nmap/ZenMap (Download) or any other port scanner. The ports should be reported as open.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.