A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or could not be accessed.

Source: Internet
Author: User
Tags stack trace

Production environment:

Operating system: Windows Server 2003

Database system: SQL Server 2005

Program Operating Environment: Iis+asp.net

The runtime error is as follows:

Line 227:// Determine database connection status

Line 228:IF (Conn. State = ConnectionState.Open)

Line 229:conn. Open ();

Line :

Line 231:cmd. Connection = conn;

source File : F:\SenateHome\App_Code\SqlHelper.cs Line : 229
Stack Trace :

[SqlException (0x80131904):in withSQL ServerA network-related or instance-specific error occurred while establishing the connection. The server was not found or could not be accessed. Please verify that the instance name is correct andSQL Serveris configured to allow remote connections. (provider:Named pipe provider, error:40-cannot open toSQL Serverthe connection)]

System.Data.ProviderBase.DbConnectionPool.GetConnection (DbConnection owningobject) +428

System.Data.ProviderBase.DbConnectionFactory.GetConnection (DbConnection owningconnection) +65

System.Data.ProviderBase.DbConnectionClosed.OpenConnection (DbConnection outerconnection, dbconnectionfactory ConnectionFactory) +117

System.Data.SqlClient.SqlConnection.Open (+122)

Sqlhelper.preparecommand (SqlCommand cmd, SqlConnection conn, SqlTransaction Trans, CommandType cmdtype, String Cmdtext, Sqlparameter[] cmdparms) in f:\senatehome\app_code\sqlhelper.cs:229

Sqlhelper.executereader (String connectionString, CommandType cmdtype, String cmdtext, sqlparameter[] Commandparameters) in f:\senatehome\app_code\sqlhelper.cs:128

_default.display () in f:\senatehome\index.aspx.cs:30

_default.page_load (Object sender, EventArgs e) in f:\senatehome\index.aspx.cs:24

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

  version information :  microsoft. NET Framework :2.0.50727.3053; ASP. NET version :2.0.50727.3053

no normal start MySQL Span style= "Font-family:arial;line-height:16px;background-color:rgb (255,255,255);" >&NBSP, server service.

Solutions such as:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/73/4B/wKioL1X5icezntOiAAEI5_cUVX8626.jpg "title=" is not named. JPG "alt=" Wkiol1x5icezntoiaaei5_cuvx8626.jpg "/>

Via a service that has been enabled to be modified to disabled, restart mysql server to function correctly.

This article is from the "linux~dba~mba~edu" blog, make sure to keep this source http://sky9896.blog.51cto.com/2330653/1695515

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or could not be accessed.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.