Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to connect to a local SQL Server installed on my PC (using my SQL login details), and for some reason, all the intuitive methods seem to fail. My connection string is something like this.
Data Source=localhost/127.0.0.1;Initial Catalog=TESTA;User ID=userid;Password=pass

(The slash is not really there, I tried both the options...)
What is missing?
Posted

Usually you just put the address 127.0.0.1 or (local)

Read this : http://www.connectionstrings.com/[^]
 
Share this answer
 
Don't know - but I know how you can find out.

In visual studio, open the Server explorer pane.
If you do not have a connection to your database, add one by Right clicking "Data Connections" and selecting "Add Connection...". Follow the dialogs until you have a connection.
In the Server Explorer pane, click your database to highlight it.
Look in the Properties pane where you will fine "Connection String" - copy and paste this and it will work.
 
Share this answer
 
Comments
ShacharK 31-Oct-11 4:19am    
It's a problem, because I'm actually not testing my application on my computer, but on a customer's computer... So I can't check it :S
Also, check in SQL Services configuration, that TCP/IP is activated for the instance you are trying to connect to.
 
Share this answer
 
Comments
ShacharK 31-Oct-11 4:21am    
Well, I know that its activated, because there is another software installed on the destination PC that is using the same database... If I only had access to its connection string, life would have been easier.
Why the hell did they change the port from 1433? Annoying people :S
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900