Cant debug asp.net project

Server Error in '/' Application.

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

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.Exception: 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) Source Error:

Line 41:             catch (Exception e)

Line 42:             {

Line 43:                 throw new Exception(e.Message.ToString());

Line 44:             }

Line 45:             finally

Source File: D:\helpdesk\HelpDesk\HelpDesk\Severity.cs Line: 43 Stack Trace:

[Exception: 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]

   HelpDesk.Severity.GetSeverities() in D:\helpdesk\HelpDesk\HelpDesk\Severity.cs:43

   HelpDesk._Default.LoadCombos() in D:\helpdesk\HelpDesk\HelpDesk\Default.aspx.cs:27

   HelpDesk._Default.Page_Load(Object sender, EventArgs e) in D:\helpdesk\HelpDesk\HelpDesk\Default.aspx.cs:21

   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14

   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35

   System.Web.UI.Control.OnLoad(EventArgs e) +99

   System.Web.UI.Control.LoadRecursive() +50

   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

February 12th, 2015 9:45am

Hello,

As the error message already says, the addressed SQL Server is not accessable. Check the SQL Server Name in your Connection string, check if the SQL Server is running and if you can connect to, e.g. with SSMS / SqlCmd.

Free Windows Admin Tool Kit Click here and download it now
February 12th, 2015 10:26am

Verify credentials which you may have provide in web.config file.

if they are wrong then correct it.

Else check for sql server services are running or not, that also makes the trouble.

if you are accessing remotely then check for the ip address ha not been changes.

Try all of this if required, probably it may help!!

if this is the answer then mark it as the answer.

February 12th, 2015 10:33am

Hi Damitha,

According to your description, you get the error(SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified). Based on my research, this issue could be due to that the client stack could not receive SSRP response UDP packet from SQL Server Browser.

Besides Olaf's and EmpAnsar's posts, you could also pay attention to the points below to troubleshoot the issue.

1.Make sure your server name is correct, no typo on the name. Some application converts \\ to \. If you are not sure about your application, please try both Server\Instance and Server\\Instance in your connection string.

2.Make sure the server machine is reachable, DNS can be resolve correctly, and you are able to ping the server.

3.Make sure SQL Browser service is running on the server.

4.If firewall is enabled on the server, you need to put sqlbrowser.exe or UDP port 1434 into exception.

5.If it still fails, you may replace server\instance with tcp:server\instance, or np:server\instance and see if it succeeds with either TCP or NP protocol.

For more information about the process, please refer to the article: http://blogs.msdn.com/b/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx?PageIndex=2#comments

Regards,
Michelle Li

Free Windows Admin Tool Kit Click here and download it now
February 13th, 2015 12:45pm

On a side note; doing what you did on line 43 is bad practice. Change your code like this:

// you lose all information of interest by doing this
throw new Exception(e.Message.ToString());

// do this instead, this preserves the stack trace and original exception
throw;

February 13th, 2015 12:52pm

Verify credentials which you may have provide in web.config file.

if they are wrong then correct it.

Else check for sql server services are running or not, that also makes the trouble.

if you are accessing remotely then check for the ip address ha not been changes.

Try all of this if required, probably it may help!!

if this is the answer then mark it as the answer.

Yes this will maximum help you.
Free Windows Admin Tool Kit Click here and download it now
April 23rd, 2015 1:01am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics