解决方法
你可以使用
Copy if newer
:
The database file is copied from the project directory to the bin directory the first time the project is built. Every subsequent time you build the project,the Date Modified property of the files is compared. If the file in the project folder is newer,it is copied to the bin folder,replacing the file that is currently there. If the file in the bin folder is newer,no files are copied. This setting persists any changes made to the data during run time,meaning that every time you run your application and save changes to the data,those changes are visible the next time you run your application.
将“复制到输出目录”属性设置为“如果更新则复制”单击数据库,并在属性窗口中将“复制到输出目录”更改为“如果更新则复制”.