2010-12-04 5 views
0

私はaspspider.comで、私のサイトをアップロードし、それは以下のmessage..whatは、という問題だった示しています...イムは完全に混乱して...ユーザーにはこの操作を実行する権限がありません。 ?なにが問題だったの?

私はすなわちASPNETDB.MDF

asp.netのデフォルトdataaseを使用
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 

答えて

2

データベースに接続するために使用するユーザーは、そのテーブルに対して選択権限を持っていないようです。

grantを使用して修正してください。

+0

これを行う方法? –

+0

web.configファイルでこれを行う方法.. –

+0

@ user522211 web.configでデータベース自体でのみ行うことはできません。権限を持っている他のデータベースユーザーのユーザー名とパスワードがある場合は、接続文字列に入れます。 –

0

あなたのデータベースは、ユーザーの許可を得ていません。接続文字列では、どのユーザーですか?このSQLユーザーに必要なアクセス権を与えるには、 'Grant'を使用します。おそらく、必要なテーブルからSELECTできるようにする必要があります。

関連する問題