473,386 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

connection to sql 2005 failed

hello every body

i did an application with c# to connect to sql server and it worked well on my local machine (to connect to my sql server 2005 on my computer),

but now i want to connect to a remote sql server 2005 which is on another computer, but it failed to connect through the application and even the my sql server management studio express 2005 and i failed to connect through visual studio 2008 servers part.

oh i went banana, i did all what i found in all posts i read.

-i made sure that the firewall give authority to my application & sql server to connect without blocking,
-added the port to the firewall
-added the /sqlexpress to server string
-added /sqlexpress,port no to the server string
-used the connection string the provider gave it to me it’s likeSqlConnection (.NET):
Data Source=db_name.db.6236289.hostedresource.com; Initial Catalog=db_name; User ID=user_id; Password=’your password’;
But also it is useless

-quite sure that my sql server tcp/ip and named pipeare enabled.

oh nooo, i don’t know what can i do???? please any one help me.

hint : the only way allowed me to connect to that sql server was the “database publishing wizard” when i tried to script my local db and to put it on the remote server, it worked well and created the tables on the remote server,
But when i tried to make the oppsite (to script the db that is remotely it failed and i get the same error)
Error details:
“A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 – No such host is known.) (.Net SqlClient Data Provider)”



------------
there is something i made now to try

i made a web page connect to that sql server with the same connection string and it worked when i uploaded to my website,

But

locally it doesn’t work, may be that means that the problem in my computer especially that my sql management studio couldn’t connect also to that remote server?!!!,

HINT : my application is a “windows forms application”

please please help me, it’s urgently.
Sep 1 '10 #1
3 1910
wizardry
201 100+
check with your server / host. typically you cannot run your development, on your production server. two separate instances.

u need direct access to the db server. which means your not able to connect.

you'll need to contact your host provider.
Sep 1 '10 #2
i tried but useless, they couldn't help me.
Sep 3 '10 #3
Aimee Bailey
197 Expert 100+
This maybe a silly question, but are you using SQL Server 2005, or SQL Server Express 2005?

The usual cause of this is that the basic setup allows you to connect on the local system using your windows credentials, but trying from another computer will fail because you would need the same credentials to access that type of account. There exists a work around, but what it involves is you enabling user accounts and allowing remote connections, after 2 mins of google, I found a tutorial that will most likely help:

http://www.linglom.com/2007/08/31/en...-2005-express/

All the best :)

Aimee.
Sep 4 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: DMAC | last post by:
The following failed in EM (or whatever it is called now management studio I think) and I scripted it out and ran it in a query window to get more info. This works fine in SQL 2000 but not in 2005....
7
by: Ray Valenti | last post by:
I am able to preview this data in the development environment, but when I run the application the error below shows up. How do I set up a Trusted Connection? -Ray Server Error in...
0
by: Ray Cacciatore | last post by:
I published my app using the VS.NET 2005 Beta's Publish Web Site option. Everything pre-compiled and sent all my compiled files to the target server, no errors popped up...but... WHen I try to...
0
by: andreas.baus | last post by:
Hello. An applicytion I wrote uses the SmtpMail and MailMessage objects (System.Web.Mail namespace) to construct an email and send it. And it is working fine ... most of the time. For some...
2
by: Dennis | last post by:
I'm getting the following problem occasionally...the application will work perfectly well for a period of time and then this pops up. I have tried turning off the default proxy in the...
1
by: Charles MacLean | last post by:
We have an application that connects to a remote site's SQL server using a VPN client. It also uses a local MS SQL database located on one of our servers. It seems once the VPN connection is...
3
by: Amar Gaikwad | last post by:
Hi All, I want to read the contents (only the filenames) from the ftp server. The code which I have throws connection timeout exception :: "A connection attempt failed because the connected...
3
by: Mad Scientist Jr | last post by:
I am getting the following error when trying to access a database with a trusted connection: "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection." My...
13
by: dfarney | last post by:
I have created a program in c# .net 2.0 that connects to a remote sql 2000 server. Connection for all our users/clients all over the US is fine, execpt one. Im thinking that it his firewall, but when...
0
by: =?Utf-8?B?UmljaGFyZCBC?= | last post by:
We have been receiving a connection error at one of our sites, our application works elsewhere. The error occurs when our application written in vb.net 2.0 running as a Windows Service under the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.