本文介绍了'/'应用程序中的服务器错误。访问被拒绝,[win32exception(0x80004005):访问被拒绝]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 您好, 对于我的组织,我开发了数据库Web应用程序(ASP.net C#),后端数据库是SQL服务器。 我最近获得了所有权我的组织中的Web服务器,我将在Intranet上托管应用程序。 在Web服务器上部署实际应用程序之前,我认为我必须使用SQL数据库创建测试应用程序进行测试。 我已在Web服务器上部署了测试应用程序。但是当我试图访问应用程序时,在尝试访问添加了带有SQL Server表的gridview的页面时出现错误。 错误详情如下。 是我错过了什么? 需要你的专业知识来指导这个错误。 服务器错误 ' /'应用程序。 访问 被拒绝描述:执行当前Web请求期间发生了未处理的异常。请查看堆栈跟踪 有关错误的更多信息,其中源自代码中的关键字>。 异常详细信息:System.ComponentModel.Win32Exception:Access 被拒绝 来源错误: 在执行当前Web请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息。 堆栈跟踪: [Win32Exception(0x80004005):访问 被拒绝] [SqlException(0x80131904):发生与网络相关或特定于实例的错误,而建立与SQL Server的连接。服务器未找到或无法访问。验证实例名称是否正确,并且SQL Server 配置为允许远程连接。 (提供者:命名管道提供程序,错误: 40 - 无法打开与SQL Server的连接)] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException) exception, Boolean breakConnection,Action`1 wrapCloseInAction)+6564850 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)+815 System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo,SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean 加密, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailov er)+6590016 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword,SecureString newSecurePassword, Boolean ignoreSniOpenTimeout,TimeoutTimer timeout, Boolean withFailover)+219 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo,字符串 newPassword,SecureString newSecurePassword,布尔 redirectedUserInstance,SqlConnectionString connectionOptions,SqlCredential凭证,TimeoutTimer超时)+6592502 系统.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout,SqlConnectionString connectionOptions,SqlCredential credential, String newPassword,SecureString newSecurePassword, Boolean redirectedU serInstance)+6592983 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity,SqlConnectionString connectionOptions,SqlCredential credential, Object providerInfo, String newPassword,SecureString newSecurePassword, Boolean redirectedUserInstance,SqlConnectionString userConnectionOptions,SessionData reconnectSessionData)+878 System.Data.SqlClient。 SqlConnectionFactory.CreateConnection(DbConnectionOptions选项,DbConnectionPoolKey poolKey,对象 poolGroupProviderInfo,DbConnectionPool池,DbConnection owningConnection,DbConnectionOptions userOptions)+1162 System.Data.ProviderBase.DbConnectionFactory。 CreatePooledConnection(DbConnectionPool池,DbConnection owningObject,DbConnectionOptions选项,DbConnectionPoolKey poolKey,DbConnectionOptions userOptions)+72 Syst em.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject,DbConnectionOptions userOptions,DbConnectionInternal oldConnection)+6596173 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject,DbConnectionOptions userOptions,DbConnectionInternal oldConnection)+103 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection,DbConnectionOptions userOptions,DbConnectionInternal&连接)+2102 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject,TaskCompletionSource`1 retry,DbConnectionOptions userOptions,DbConnectionInternal& connection)+116 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection) owningConnection,TaskCompletionSource`1 retry,DbConnectionOptions userOptions,DbConnectionInternal oldConnection,DbConnectionInternal& connection)+1079 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection,DbConnectionFactory connectionFactory,TaskCompletionSource`1 retry,DbConnectionOptions userOptions)+6600667 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)+233 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)+278 System.Data.SqlClient .SqlConnection.Open()+239 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,DataTable [] datatables, Int32 startRecord, Int32 maxRecords, String srcTable,IDbCommand命令,CommandBehavior行为)+292 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords,字符串 srcTable,IDbCommand命令,CommandBehavior行为)+420 System.Data.Common.DbDataAdapter.Fill (DataSet dataSet, String srcTable)+277 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments)+3319735 System。 Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments,DataSourceViewSelectCallback callback)+28 System.Web.UI.WebControls.DataBoundControl.PerformSelect()+313 System.Web.UI.WebControls.BaseDataBoundControl.EnsureD ataBound()+ 146 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()+192 System.Web.UI.Control.EnsureChildControls()+ 189 System.Web.UI .Control.PreRenderRecursiveInternal()+ 60 System.Web.UI.Control.PreRenderRecursiveInternal()+ 222 System.Web.UI.Control.PreRenderRecursiveInternal()+ 222 System.Web。 UI.Page.ProcessRequestMain( Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)+4297 版本信息:Microsoft .NET Framework版本: 4 。 0 。 30319 ; ASP.NET版本: 4 。 0 。 30319 。 34009 我的尝试: 我已经在Web服务器上部署了测试应用程序。但是当我试图访问应用程序时,在尝试访问添加了带有SQL Server表的gridview的页面时出现错误。 错误详情如下。 是我错过了什么? 需要你的专业知识来指导这个错误。解决方案 由于你的web应用程序无法连接的异常SQLSERVER实例。以下是解决问题的方法: 1. 检查您的服务是否正在运行 转到所有程序> Microsoft SQL Server 2012>配置工具> SQL Server配置管理器> SQL Server服务 检查以确保SQL Server服务状态正在运行。 或 打开运行命令控制台(Windows + R),然后键入 services.msc 。您将系统中的所有服务和检查SqlServer(Sqlexpress)服务正在运行模式。 2. 确保您的数据库引擎配置为接受远程连接 开始>所有程序> SQL Server 2005>配置工具> SQL Server表面区域配置 单击服务和连接的表面区域配置 选择出现问题的实例>数据库引擎>远程连接 启用本地和远程连接 在运行命令窗口中使用 services.msc 重新启动实例(在#中讨论) 1) 3. 在SQL Server配置中启用TCP / IP 转到所有程序>> Microsoft SQL Server 2012>配置工具>> SQL Server配置管理器>>选择TCP / IP 右键单击TCP / IP>>单击启用 然后在运行命令窗口中使用 services.msc 重新启动sqlserver服务(在#1中讨论) ) 最后你需要检查它可能是服务器防火墙设置,因为有时防火墙会阻止来自其他服务器的传入请求。并检查您是否提供正确的连接字符串意味着用户名,密码,服务器等。 运行此更新: asp_net_regiis .EXE Hello,For my organization, I have developed database web application (ASP.net C#) where the backend database is SQL server.I recently got ownership of Web server in my organization where I am going to host the application on intranet.Before deploying the actual application on web server, I thought I have to create test application with SQL database for testing.I have deployed the test application on web server. but when I am trying to access the application getting error when trying to access page where the gridview with SQL server table is added.Details of error is as follow.Is I am missing something?Need you expertise to guide on this error.Server Error in '/' Application.Access is denied 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.ComponentModel.Win32Exception: Access is deniedSource 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:[Win32Exception (0x80004005): Access is denied][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)] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +6564850 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +815 System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover) +6590016 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) +219 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) +6592502 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) +6592983 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData) +878 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +1162 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +72 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +6596173 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +103 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +2102 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +116 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +1079 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +6600667 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) +233 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +278 System.Data.SqlClient.SqlConnection.Open() +239 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +292 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +420 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +277 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +3319735 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +28 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +313 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +146 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +192 System.Web.UI.Control.EnsureChildControls() +189 System.Web.UI.Control.PreRenderRecursiveInternal() +60 System.Web.UI.Control.PreRenderRecursiveInternal() +222 System.Web.UI.Control.PreRenderRecursiveInternal() +222 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4297Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009What I have tried:I have deployed the test application on web server. but when I am trying to access the application getting error when trying to access page where the gridview with SQL server table is added.Details of error is as follow.Is I am missing something?Need you expertise to guide on this error. 解决方案 Exception due to your web application is not able to connect SQLSERVER instance. Following are options to resolve the problem:1. Check if your service is running upGo to All Programs > Microsoft SQL Server 2012 > Configuration Tools > SQL Server Configuration Manager > SQL Server ServicesCheck to make sure SQL Server service status is Running.orOpen run command console(Windows + R) then type services.msc. You will all services in your system and check SqlServer (Sqlexpress) service is running mode.2. Make sure your database engine is configured to accept remote connectionsStart > All Programs > SQL Server 2005 > Configuration Tools > SQL Server Surface Area ConfigurationClick on Surface Area Configuration for Services and ConnectionsSelect the instance that is having a problem > Database Engine > Remote ConnectionsEnable local and remote connectionsRestart instance using services.msc in run command window(discussed in #1)3. Enable TCP/IP in SQL Server ConfigurationGo to All Programs >> Microsoft SQL Server 2012 > Configuration Tools >> SQL Server Configuration Manager >> Select TCP/IPRight Click on TCP/IP >> Click on EnableThen restart the sqlserver service using services.msc in run command window(discussed in #1)Lastly you need to check that it might be server firewall setting because sometimes firewall blocks incoming request from other servers. And also check you are providing correct connection string means username, password, server etc..run this update:asp_net_regiis.exe 这篇关于'/'应用程序中的服务器错误。访问被拒绝,[win32exception(0x80004005):访问被拒绝]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-05 12:23