Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hey people,

I have a simple application which inserts data into database. The database is located on a remote machine.
However this machine(which has SQL) has a router installed. My pc(which has application) can find this machine's
IP address by using a code. Everything is okay till this stage.
Now when I try to insert data into DB it gives me error "No Such Host Found". As these machines are connected through
same router, so i need to ask that do i have switch on internet everytime I try to insert data Or is there any other way
around this problem?


NOTE : Its not a Web Application. Its a simple C# application.

Please help

Thanks and regards
Ajinkya
Posted

Try one with making Security=false in the connection string
 
Share this answer
 
Could you be having a firewall issue or connection string. You can try disabling the firewall to see if it is causing the problem.

The connection to the database is basically just tcp/ip traffic so if both of your server and client are in the local network, internet doesn't have anything to do with this. Also note that you may have firewall on both sides, at the server and at the client, depending on the OS versions.

Check the connection string that it's properly pointing to the correct server, correct instance name (if any) and with corerct authentication. You can check the connection string using http://www.connectionstrings.com/[^]
 
Share this answer
 
Comments
ajinkya11121 24-Mar-11 3:04am    
hey,

thanks for your reply.
Let me give connection string I am using.


"Data Source=xxx.xxx.x.x;Network Library=DBMSSOCN; Initial Catalog=MIS;Integrated Security=True ;User ID=sa; Password=sql@123";

My sql server has a default instance name.Do i have to add that too? and one more thing, i have given it a server name. so am i supposed to add it?


Thanks
Wendelius 24-Mar-11 13:44pm    
If you're using named instance you have to add it to the connection string, for example:
Data Source= 127.0.0.1\InstanceName or Data Source= ServerName\InstanceName

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