Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# SQL Application Server
Hi everybody,
 
Firstly, excuse me if I opened my subject in wrong place.
 
And let me explain my story in a short way.
 
I developed a Windows application with VS 2008 C# and SQL Server 2005. I installed my application on test environment.There was no error when
installing.But,when I try to run my program, it gave me the error below:
 
"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
 
My test environment specifications are:
 
- Windows XP SP2
- NET Framework 3.5
- SQL server 2005 express
 
My deployment package has Windows Intaller 3.1, NET framework 3.5, SQL server 2005 express sp2, and my application.
 
In order to test my SQL server 2005 express on test machine, I installed SSMS Express. I can reach my sql instance as its name is SQL_Express.And I can do my database actions by using SSMS Express.
 
But,when I tried to run my application, I take this error above. Frown | :(
 
Can someone help me please?
 
Thanks of all.
 
Kerem
Posted 11-Feb-11 4:11am
Edited 11-Feb-11 11:24am
Henry Minute223.8K
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Perhaps your ConectionString is wrong , use ".\SQLEXPRESS" or "localhost\SQLEXPRESS" in your connection string.(in app.confog file)
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

If you are using ODBC settings, check that these have been configured properly.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Few things to check:
- is the SQL Server listening on remote clients (remote connections allowed). You can use the configuration utility on the server side to check this
- Did you install named instance. If yes, do you include the instance name in your connection string
- Firewall between client and server? Is it configured correctly to allow traffic.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

hi,
 
arvane's answer is good for me.it is OK. I changed instance name from my c#code.then I can get it.
 
thanks.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 587
1 Sergey Alexandrovich Kryukov 544
2 Maciej Los 325
3 DamithSL 223
4 Mathew Soji 195
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,712
2 DamithSL 5,461
3 Manas Bhardwaj 4,916
4 Maciej Los 4,475


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 11 Feb 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100