Search code examples
c#.netsql-serverwinformswindows-vista

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


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 systems. My application shows a message similar to

Failed to update .mdf database because the database is read-only

Can anyone give me a solution to this?


Solution

  • If the MDB file is in your application path, then the default permissions would require elevation of rights to be able to write to the files -- I'd recommend moving the data to the ApplicationData shared folder, where end users will have write permissions by default