Solved

SQL Express 2005 connection issues from remote server.

Posted on 2010-09-17
6
338 Views
Last Modified: 2012-05-10
I am trying to use a pre built website for an internal application to connect to a sql database running on SQL 2005 express ed.

I get the below error on the web page, I know that this is commonly an issue with allowint remote connections, this has been done.  I am able to connect to the sql server via management studio express from the same server in which I am running the website with the below errror.

I have triple checked the username, password, as well as the IP address for the server and the database name.  All is correct, i have even tried using the sa username and password to see if it was a rights thing but all to no avail.

Error:
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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[SqlException (0x80131904): 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
   PageCustomizer.PageConfigured(String pagename) +235
   PageCustomizer.LoadControls(ControlCollection& ctrls, String pagename) +119
   CustomizerRoutines.InitializeCustomFields(ControlCollection controls, String pagename) +53
   WebFrameworkPage.SharedLoadPage(String pagename, String& lbox, Page& Page, ControlCollection& Controls, Type errorEnum) +387
   WebFrameworkPage.LoadPage(String pagename, String& lbox, Type errorEnum, Boolean nestedMasterPage) +79
   Login.Page_Load(Object sender, EventArgs e) +87
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4206; ASP.NET Version:2.0.50727.4205
End Error:

Any thoughts would be helpful.
0
Comment
Question by:Binatech
  • 4
6 Comments
 
LVL 16

Expert Comment

by:carsRST
ID: 33703370
Check to see if TCP/IP is enabled.

From the Microsoft SQL Server 2005 -> Configuration Tools, open the 'Microsoft SQL Server Configuration Manager'.
 
Expand ‘SQL Server 2005 Network Configuration’, and then click ‘Protocols for <Instance Name>’.
<Instance Name> is the name of the instance of Microsoft SQL Express being used by the GFI product.
 
Right-click ‘TCP/IP’ and then click ‘Enable’. The icon for the protocol will change to show that the protocol is enabled.
0
 
LVL 16

Expert Comment

by:carsRST
ID: 33703454
Also, check to make sure you're using the named instance when you connect.  IP number alone won't do it.
0
 

Author Comment

by:Binatech
ID: 33703557
Thanks for your responses,  TCP/IP is enabled, I had checked that before however I just double checked it again and confirmed.  Also Named Pipes is enabled as well.

Tried changing the connection string to show the server name but receive the same error.

Any additional thoughts?
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 16

Expert Comment

by:carsRST
ID: 33703583
There should be "named instance'  (which is not the server name).  Are you including that when you connect?
0
 
LVL 8

Expert Comment

by:mustaccio
ID: 33703588
Since you are using a Named Pipe connection, make sure that you specify the same pipe name on both the server and the client, or, better yet, switch to TCP/IP connectivity.
0
 
LVL 16

Accepted Solution

by:
carsRST earned 500 total points
ID: 33703604
Your connection would be in this format:

\\computer_name\instance_name
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question