Apparently this connection string is incorrect? connectionString="Server=mydb.com:1433/sqlExpress;Database=d;User Id=d;Password=pw;"
Asked
Active
Viewed 6,966 times
-3
-
3Maybe [this](https://www.connectionstrings.com/sql-server-2008/) could be helpful. – DCruz22 May 13 '16 at 18:22
-
I think you can provide some details in your question. Like the method you're using to connect. Are you sure the problem is in the `connectionstring`?. Are you getting an exception? – DCruz22 May 13 '16 at 18:26
-
The documentation around this stuff is as clear as it can possibly be. – Just Do It May 13 '16 at 18:27
-
Seems pretty clear to me. The server was not found or is not accessible. So the first thing you should check is whether the server exists **as you named it in the connection string**. I will guarantee that it does not, and I don't even have to look at your environment to make that statement. The link that DCruz22 provided actually solves your problem if you read it closely enough, especially this part https://www.connectionstrings.com/sqlconnection/connection-to-a-sql-server-instance/ – Craig W. May 13 '16 at 18:33
-
1@CraigW. he is actually specifying the port incorrectly. it's a comma not a colon. – Cubicle.Jockey May 13 '16 at 18:36
1 Answers
3
the first think that I see is that you have type wrong this part
Server=mydb.com:1433
use
Server=mydb.com,1433
the sql server use the comma to separate the port.
Also take a look at that answer: Setting up connection string in ASP.NET to SQL SERVER