Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a software written in c # and database sql. When I pack and install it on another computer is using win xp. software to run on, then it does not load up the database and the error "Can not connect to database". please help me solve this problem.
Posted

1 solution

You need to verify the points listed below:
1) It sounds like the instance you're trying to reach is SQL Express. In which case the instance will be called myserver\sqlexpress ("SQLEXPRESS" literal; case doesn't matter). "myserver" won't work with a "named instance"; "myserver\sqlexpress" might do the trick.

2) You MUST enable TCP/IP with the SQL Configuration tool (installed when you installed MSSQL and SSMS).

3) You should turn off the firewall (brute force - don't do it if you don't have to) or enable MSSQL in the firewall (MSSQL is not enabled by default)


Or you can read How to Troubleshoot Connecting to the SQL Server Database Engine[^].

Also read similar articles:
Error Message: Cannot Connect to SQL Server Database[^]
SQL SERVER – Fix : Error : 1326 Cannot connect to Database Server Error: 40 – Could not open a connection to SQL Server[^]


--Amy
 
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