Solved

SQL Express 2005 connection issues from remote server.

Posted on 2010-09-17
6
335 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now