您的位置:首页 > 大数据 > 人工智能

solution:Failed to update database "XXX.MDF" because the database is read-only.

2009-09-25 20:00 776 查看
As usual I did Build - Publish Web Site and then copied and pasted the
published directory to my web server. When browsing any of the web
pages that use the SQL Server 2005 database I get this error message:
Failed to update database "XXX.MDF" because the database is read-only.

 

Solution:

This worked for me:

1) Make sure App_Data directory or any contained files does not
have file system attribute Read-only set. (I had some files marked as
Read-only)

2) Give user ASPNET and NETWORK SERVICE Modify control over the App_Data directory. (I had to add both these)

3) Run IISRESET to restart IIS to refresh its permissions.

 

and step 2 works here:

 after selecting "properties on the "App_Data" directory,

1.  Select the security tab

2. CLick on Add... under "Group or User names:" table

3. On the next window, select Advanced, another window appears and
on this, select or rather click on "find now" and a list of Groups and
Users should appear on the bottom table.

4.  Click on ASPNET followed by OK, and the same on the next 2 windows.

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐