2014-03-13 19 views
0

我正在使用MVC 4,我對它很陌生。我在執行程序時遇到了問題,它顯示無法啓動IIS服務器的錯誤,然後我使用項目屬性更改了服務器設置。對象'Student',數據庫'studentDB',模式'dbo'拒絕SELECT權限?

也嘗試終止「WebDev.WebServer40.EXE」過程,但我需要一次又一次地做到這一點。

我切換到選項「使用本地IIS Web服務器」的「使用Visual Studio開發服務器」,但它再次被顯示以下錯誤:

Unable to connect to ASP.Net Development Server. 

現在我主持這個項目到IIS服務器並運行從我的項目,但現在我面臨着與數據庫的問題的一些錯誤,那就是:

The SELECT permission was denied on the object 'Student', database 'studentDB', schema 'dbo' 

我使用Microsoft SQL Server 2008 R2和在web.config中的連接字符串是:

<add name="studentDBEntities" connectionString="metadata=res://*/EFModel.csdl|res://*/EFModel.ssdl|res://*/EFModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=SYS6\SQLSERVERR2;initial catalog=studentDB;User Id=username; 
Password=password;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /> 

現在有什麼解決這個問題的,我在網上搜索過,但沒有任何工作?

感謝您的幫助。

回答

0

不知道你試過了什麼,它會在黑暗中刺傷。

在我看來,您需要更新您在連接字符串中指定的用戶名的特權,以便能夠從所選表中進行選擇。

這應該有助於http://technet.microsoft.com/en-us/library/ms188371.aspx

否則,您授予用戶名的角色的db_datareader應該讓它讀取數據。它確實打開了用戶相當廣泛,所以我會小心你如何使用它。

相關問題