locked
SQL Server Express connection problems RRS feed

  • Question


  • I can't connect app to SQLEXPRESS via the local network.
    It works on same PC.

    In SQL Server Configuration Manager > SQL Server 2005 Network Configuration > Protocols for SQLEXPRESS >  TCP/IP and Named Pipes - set to Enabled.

    In Server Properties > Security > SQL Server and Windows Authentication mode is set.

    Firewall and antivirus are stopped during tests.

    What else can be cause of this trouble?

    Thanks for any help.

    Sunday, July 8, 2007 8:48 AM

Answers

  •  milicica wrote:

    Thank you for your answers. More precisely:

    Error message:

    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)

    Connection string:

    mConnection = new SqlConnection(@"data source= computerNameServer\sqlexpress;" +
                        "database=myDatabase;" +
                        "UID=x;PWD=y;");

    Actually a simple known error it means you have not used the surface area configuration tool to enable browser service, allow both local and remote and enable both TCP/IP and Named Pipes.  If you don't have Management Studio as one of the previous posters said get it.  The last I know was you change to SQL Server Express with Advanced features for that.  Try to take time to know the surface area configuration tool it covers all connection related configurations.  Hope this helps.

     

     

    Sunday, July 8, 2007 11:23 AM

All replies

  • What is the error message you are getting ?

    Kusala

    Sunday, July 8, 2007 9:08 AM
  • What the server name do u use?

    Smth like ".\SQLExpress" or "(local)\SQLExpress" ?

    Sunday, July 8, 2007 9:27 AM
  • On the machine where mdf file is placed and SQL Express is installed, install also Sql Server Management Studio Express. Open it and attach your mdf file, while seting property User Instance to false; Adjust security for your database, add users that can access database and that is more or less everything. From other machine quickest way to create connection is using Connection wizard from Server Explorer in Visual Studio. After that, take connection string and put it in your application connection string.
    Sunday, July 8, 2007 10:31 AM

  • Thank you for your answers. More precisely:

    Error message:

    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)

    Connection string:

    mConnection = new SqlConnection(@"data source= computerNameServer\sqlexpress;" +
                        "database=myDatabase;" +
                        "UID=x;PWD=y;");

    Sunday, July 8, 2007 11:00 AM
  •  milicica wrote:

    Thank you for your answers. More precisely:

    Error message:

    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)

    Connection string:

    mConnection = new SqlConnection(@"data source= computerNameServer\sqlexpress;" +
                        "database=myDatabase;" +
                        "UID=x;PWD=y;");

    Actually a simple known error it means you have not used the surface area configuration tool to enable browser service, allow both local and remote and enable both TCP/IP and Named Pipes.  If you don't have Management Studio as one of the previous posters said get it.  The last I know was you change to SQL Server Express with Advanced features for that.  Try to take time to know the surface area configuration tool it covers all connection related configurations.  Hope this helps.

     

     

    Sunday, July 8, 2007 11:23 AM