stephen wang

stephen的记事本。

导航

« MSSQL数据库质疑的解决方案该死的 系统故障: 停止错误 错误终于搞定了 »

拒绝了对对象 '表名(数据库 '数据库名',所有者 'dbo')的 SELECT 权限。

错误:

System.Data.SqlClient.SqlException: 拒绝了对对象 'Dentists'(数据库 'dentists',所有者 'dbo')的 SELECT 权限。
    at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
    at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
    at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)

 

解决方案:

在数据库里相应的用户权限中,把db_denydatareader的复选框的勾去掉。很多初学者,总认为在数据库权限中选的越多,权限越大。其实这是错误的!就像人权一样,每个国民都有自己的权利,同时也会有对国民行为的限制。db_denydatareader是拒绝访问。

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Category

Recent Comments

Recent Article

Powered By Z-Blog 1.8 Walle Build 100427

Copyright xxxx-xxxx Your WebSite. Some Rights Reserved.