访问被拒绝System.ComponentModel.Win32Exception:访问被拒绝

时间:2016-06-28 23:59:16

标签: c# asp.net .net sql-server

请在网站登录我的管理员帐户时帮助我解决我的Erorr ....

访问被拒绝 描述:执行当前Web请求期间发生未处理的异常。请查看堆栈跟踪,以获取有关错误及其在代码中的起源位置的更多信息。

异常详细信息:System.ComponentModel.Win32Exception:拒绝访问

来源错误:

在执行当前Web请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息。

堆栈追踪:

[Win32Exception(0x80004005):访问被拒绝]

[SqlException(0x80131904):建立与SQL Server的连接时发生与网络相关或特定于实例的错误。服务器未找到或无法访问。验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。 (提供程序:SQL网络接口,错误:56 - 无法从注册表中指定的位置加载SQLUserInstance.dll。验证是否已正确安装SQL Server Express的本地数据库运行时功能。)]    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity标识,SqlConnectionString connectionOptions,SqlCredential凭证,Object providerInfo,String newPassword,SecureString newSecurePassword,Boolean redirectedUserInstance,SqlConnectionString userConnectionOptions,SessionData reconnectSessionData,DbConnectionPool pool,String accessToken,Boolean applyTransientFaultHandling)+830    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions选项,DbConnectionPoolKey poolKey,Object poolGroupProviderInfo,DbConnectionPool池,DbConnection owningConnection,DbConnectionOptions userOptions)+329    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool池,DbConnection owningObject,DbConnectionOptions选项,DbConnectionPoolKey poolKey,DbConnectionOptions userOptions)+38    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject,DbConnectionOptions userOptions,DbConnectionInternal oldConnection)+682    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject,DbConnectionOptions userOptions,DbConnectionInternal oldConnection)+89    System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject,UInt32 waitForMultipleObjectsTimeout,Boolean allowCreate,Boolean onlyOneCheckConnection,DbConnectionOptions userOptions,DbConnectionInternal& connection)+426    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次重试)+217    System.Data.SqlClient.SqlConnection.Open()+96    System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser用户)+43    System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe()+41    System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode()+21    System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)+57    System.Data.Linq.Table 1.GetEnumerator() +41 System.Data.Linq.Table 1.System.Collections.Generic.IEnumerable.GetEnumerator()+9    System.Collections.Generic.List 1..ctor(IEnumerable 1个集合)+369    System.Linq.Enumerable.ToList(IEnumerable`1 source)+58    c:\ Users \ Emperor.Emperor-PC \ Desktop \ New文件夹(3)\ Bikes \ DbClass1.cs中的bicycle.DbClass.GetUserID(String UserName,String PassWord):193    c。\ Users \ Emperor.Emperor-PC \ Desktop \ New文件夹(3)\ Bikes \ User \ LogInControl.ascx.cs中的bicycle.Cart.LogInControl.aaddD_Click(Object sender,EventArgs e):20    System.Web.UI.WebControls.Button.OnClick(EventArgs e)+9692626    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)+108    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)+12    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,String eventArgument)+15    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)+35    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,Boolean includeStagesAfterAsyncPoint)+3562

1 个答案:

答案 0 :(得分:0)

如果你在Windows上,创建一个.udl文件并测试你的数据库连接字符串 MSDN

  1. 创建文本文件并将扩展名重命名为.udl
  2. 双击该文件并输入您的数据库连接信息
  3. 验证您是否可以连接到数据库
  4. 验证您的应用程序是否使用相同的连接字符串