Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Client Application Cannot connect to SQL SERVER 2005 Express

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-03-07 : 08:17:03
Agron Bauta writes "I have developed a C# Windows Application that uses SQL 2005 EXPRESS and works just fine on the developer machine (XP Pro SP2).
When I deploy the app to the client machine (XP Pro SP2) the application cannot connect to the DB. The error message is the following:
=================================
The Error:

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)

End Error
=================================

For now, the client application and the database are in the same standalone computer not connected to a network. I don't know if the error message applies to my case since I am not connecting to the DB remotely.

My connection string is stored in the .config file like the following:

<add key="connStr" value="data source=DEVCOMP\SQLEXPRESS;initial catalog=INVENTORY;integrated security=SSPI;persist security info=False;workstation id=DEVCOMP;packet size=4096;" />

(this connection string works just fine on the developer machine)

When I deploy the application on the client I only change the name of the server (to e.g. MYCOMPUTER) like:

<add key="connStr" value="data source=MYCOMPUTER\SQLEXPRESS;initial catalog=INVENTORY;integrated security=SSPI;persist security info=False;workstation id=MYCOMPUTER;packet size=4096;" />

Here is one strange thing:

On the client machine I use the command line utility SQLCMD and I connect without problem and run SQL queries without problem:
>SQLCMD -S MYCOMPUTER\SQLEXPRESS

However, when I try to list the server from SQLCMD like so:

>:ServerList

I get no list of available Server(s).

In the contrary when I run >:ServerList on the Developer machine I get the servers listed, like so:

>:ServerList
Servers:
DEVCOMP
DEVCOMP\SQLEXPRESS

I tried SQL Server Configuration Manager an in both machines the settings are the same.

Any help/info on this problem will be highly appreciated.

Regards & thanks,

Agron Bauta"
   

- Advertisement -