Failed to update .mdf database because the database is read-only (Windows application)

前端 未结 5 997
礼貌的吻别
礼貌的吻别 2020-11-29 10:54

I\'ve created a database windows application using in C#. My application is running successfully on Windows XP, but it doesn\'t properly execute on Vista or Windows 7 system

5条回答
  •  一生所求
    2020-11-29 11:33

    I ran into this related to localdb, the file is named:

    myfolder/mysolution/myproject/App_Data/something.mdf
    

    The way I fixed it is to right-click on the top level folder (myfolder) and then choose Properties, then choose Edit, then select Users, add to users either the Modify permission or both Modify and full control (this is a development environment) and then click apply.

    So in other words, in my experience, it doesn't matter what folder you put the localdb in, you just need to give Users permission to write.

提交回复
热议问题