“/”应用程序中的服务器错误。

在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: SQL Network Interfaces, error: 26 - 定位指定的服务器/实例时出错)

说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.Data.SqlClient.SqlException: 在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: SQL Network Interfaces, error: 26 - 定位指定的服务器/实例时出错)

源错误:


行 122:    //公司职位
行 123:    int comId = row.com_Id;
行 124:    IEnumerable<dynamic> list = JobCLS.Company.Job.GetJobsList4Front(row.com_Id, true, true, 1, 11);
行 125:    list = list.Where(p => p.job_Id != jobId).Take(10).ToList();
行 126:    int rcount = list.Any() ? list.First().rcount : 0;

源文件: d:\wwwroot\www.dazhonghr.com.v2014\company\job.cshtml    行: 124

堆栈跟踪:


[SqlException (0x80131904): 在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: SQL Network Interfaces, error: 26 - 定位指定的服务器/实例时出错)]
   System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +347
   System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +78
   System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +191
   System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +154
   System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +21
   System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) +90
   System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +443
   System.Data.SqlClient.SqlConnection.Open() +96
   WebMatrix.Data.Database.EnsureConnectionOpen() +46
   WebMatrix.Data.<QueryInternal>d__0.MoveNext() +67
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +387
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
   WebMatrix.Data.Database.Query(String commandText, Object[] parameters) +100
   Library.DataBase.Query(String procedureName, Dictionary`2 args, DbType dbType) +70
   JobCLS.Company.Job.GetJobsList4Front(Int32 comId, Boolean enable, Boolean ispassed, Int32 pIndex, Int32 pSize) +243
   ASP._Page_company_job_cshtml.Execute() in d:\wwwroot\www.dazhonghr.com.v2014\company\job.cshtml:124
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +198
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +69
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +131
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +116


版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.7.4087.0