【问题标题】:User does not have permission to perform this action. ? what was the problem?用户无权执行此操作。 ?问题是什么?
【发布时间】:2011-05-20 03:17:24
【问题描述】:

当我在 aspspider.com 上传我的网站时,它会显示以下消息..那是什么问题...我完全糊涂了..

我使用asp.net的默认dataase即ASPNETDB.MDF

Server Error in '/dobriyal' Application.

User does not have permission to perform this action.

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.Data.SqlClient.SqlException: User does not have permission to perform this action.

Source Error: 


Line 7:          Dim cmdSelect As New System.Data.SqlClient.SqlCommand("SELECT Password FROM a1_admins WHERE EmployeeId =" & TextBox1.Text & " And Email = '" & TextBox2.Text & "'", SQLData)
Line 8:  
Line 9:          SQLData.Open()
Line 10:         Dim dtrReader As System.Data.SqlClient.SqlDataReader = cmdSelect.ExecuteReader()
Line 11:         If dtrReader.HasRows Then

Source File: C:\MemberSites\MemberSites_AspSpider_Org\dobriyal\webroot\admin\forgot_password.aspx.vb    Line: 9 

Stack Trace: 


[SqlException (0x80131904): User does not have permission to perform this action.]
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +1019
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
   System.Data.SqlClient.SqlConnection.Open() +125
   admin_forgot_password.Button1_Click(Object sender, EventArgs e) in C:\MemberSites\MemberSites_AspSpider_Org\dobriyal\webroot\admin\forgot_password.aspx.vb:9
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

【问题讨论】:

    标签: asp.net windows vb.net hosting web-hosting


    【解决方案1】:

    看起来您用来连接数据库的任何用户都没有对该表的选择权限。

    使用grant 来解决这个问题。

    【讨论】:

    • @user522211 您不能仅在数据库本身的 web.config 中执行此操作。如果您有其他具有权限的数据库用户的用户名和密码,请将其放在连接字符串中。
    【解决方案2】:

    是您的数据库不允许用户权限。在您的连接字符串中,它是什么用户?使用“Grant”为该 SQL 用户提供必要的访问权限。可能需要能够从必要的表中进行选择。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-12
      • 2019-01-28
      • 2019-07-24
      • 2011-02-10
      • 2021-09-30
      • 2020-11-29
      • 2020-08-16
      • 1970-01-01
      相关资源
      最近更新 更多