Unable to update database .MDF is Read Only

前端 未结 5 1877
感情败类
感情败类 2021-01-14 10:44

I have a local DB that I have in an application. When I install it on another machine I get the error

Unable to update database.. .mdf is read only.<

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-14 11:01

    I solved the same problem as follows:

    While creating "Setup", I manually added my database files database.mdf and database_log.ldf into the Application Folder file. But after adding these files, make sure that the ReadOnly option in the Properties section is False.

    Also "connectionString" I use:

    connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\database.mdf;Integrated Security=True;Connect Timeout=30" 
    

提交回复
热议问题