Click here to Skip to main content
15,909,332 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to connect database to C# Project. when i trying to connect the "A network related error occurred while establishing connection to SQL sever. the server was found or was not accessible. and show error 40"

What I have tried:

i allow sql Server configure to remote connection. Enable TCP/Ip enavle in sql manager
Posted
Updated 23-Mar-19 2:30am
Comments
MadMyche 23-Mar-19 8:29am    
First thing I would do is try to connect to it with another client

Start by looking at your connection string: most problems are there.

This may help: Simple SQL Connection String Creation[^]
 
Share this answer
 
Comments
Atta Ur Rahman 118 23-Mar-19 9:02am    
Thank You Sir. It Works. My database is connected to my Project.
OriginalGriff 23-Mar-19 9:10am    
You're welcome!

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