2016-11-22 5 views
0

私はSQL Server Expressでデータベースを使用してWebアプリケーションを作成しました サーバーを開いてビジュアルスタジオでテーブルを構築しました(別の方法では見つかりませんでした) データベースベースのWebサイトオンラインで)私は許可がないと言っています 誰かがビジュアルスタジオを介してアクセス許可を追加する方法を知っていますか?sql server expressアクセス許可

エラー:

Server Error in '/' Application.

The SELECT permission was denied on the object 'UsersTable', database 'master', schema 'dbo'.

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: The SELECT permission was denied on the object 'UsersTable', database 'master', schema 'dbo'.

Source 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:

[SqlException (0x80131904): The SELECT permission was denied on the object 'UsersTable', database 'master', schema 'dbo'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action 1 wrapCloseInAction) +3279580
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +791
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4927
System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +92
System.Data.SqlClient.SqlDataReader.get_MetaData() +102
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +552
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +3114
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource
1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +554
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +98
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +307
System.Data.SqlClient.SqlCommand.ExecuteReader() +132
KIP_FP.KIPDB.chackUser(String userN) in C:\Users\Administrator\Documents\KIP-FP\KIP-FP\KIPDB.cs:31
KIP_FP.KIPBL.chackUser(String userN) in C:\Users\Administrator\Documents\KIP-FP\KIP-FP\KIPBL.cs:37
KIP_FP.loginUserPage.Button1_Click(Object sender, EventArgs e) in C:\Users\Administrator\Documents\KIP-FP\KIP-FP\Login.aspx.cs:34
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +11750641
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +150 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6016

+0

新しいデータベースを作成したか、またはマスターデータベース内にテーブルのみを作成しましたか? –

+1

関連していませんが、Visual Studioを使用するのではなく、SQL Management Studioを使用することをお勧めします。 –

答えて

0

あなたはUsersTableテーブルにSELECTする権限を持っているが、それは何の権限を持っていない別のユーザーアカウントで実行されているため、Webアプリケーションのアプリケーションプールは、それを持っていません。

USE master; 
GRANT SELECT ON OBJECT::dbo.UsersTable TO PoolUser; 
GO 

しかし、最初にあなたがアプリケーション上にあるユーザーを見つける必要があります:あなたはこのような何かを実行する必要が許可を追加するには 。プール。

+0

どのユーザーがApp上にいるのかを知る方法プール? –

+0

私はあなたのWebサーバーがIISであると仮定していますので、このmsの記事は役に立ちます。 https://www.iis.net/learn/manage/configuring-security/application-pool-identities プールの識別情報を調べる必要があります。 –

関連する問題