Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have connected to remote sqlserver now sqlserver is open on my computer and I have window application in this I want to connect remote sever so I have define connection string in app.config as-
<app settings="">
<add key="BACKUP_DATABASE_SERVER" value="Network Library=DBMSSOCN;Data Source=SANJAY\SQLEXPRESS;Uid=guest;Pwd=guest;Integrated Security=true;" />
</app>/pre>

but when I go for open database that time gives exception Connection Failed.
Thank You
Posted
Updated 27-May-11 0:21am
v2

You probably dont have appropriate rights to access the DB.
BTW- it is never a good idea to post your username and password in a public forum.
 
Share this answer
 
v2
Does the Remote SQLServer grant access to your server your website is on?
You sometimes need to (Depending on security on servers) to grant access to a static IP address.
For example in a website I have created I need to access a database on site, and display information to users online. But to do this, on the server on site, I needed to allow firewall access to the website before it could connect properly

http://technet.microsoft.com/en-us/library/cc646023.aspx[^]
That site may help you set up firewall access.

Check this site out for help with connection strings
http://www.connectionstrings.com/[^]
 
Share this answer
 
v2
Comments
kailash solanki 27-May-11 6:19am    
remote sqlserver is connected to my local sqlserver but when i go for connect remote server to my application that time it gives expection .and i ahve test remote server to my web site with sane connection string it working fine. but it gives errer in window app
Rob Branaghan 27-May-11 6:31am    
Ok, so your remote database is where, somewhere else in the world? (Such as a hosted database)
And when you connect to it from a website it works.
Is this website it works from on the same server as the database?
kailash solanki 27-May-11 6:36am    
ohhhh my database on remote sqlserver.i have connected to that remote sqlserver to my own pc.but when i go for connect to my app. that time my connection string issue is occering that is proble it gives expection.
Rob Branaghan 27-May-11 6:40am    
Try the connection strings website, it will help you build it up
If the Database is on a remote server the connection string needs to tell it where that is, whether it be by IP address and port or computer name if on local domain.
kailash solanki 27-May-11 7:22am    
is there any different setting for Window app .coz remote database is woring with my website and same connection string u am using in my window app in app.config that time issue .

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