save data to DB

怎甘沉沦 提交于 2019-12-02 08:08:41

问题


I am using Visual Studio 2010 with SQL Server Express and LINQ to SQL

The application runs correctly when inserting data into the database during application execution. The data is inserted to the database. But, when I stop the application and click show table data in server explorer I do not see any data. Why is this so?

Here the values for the copy output direction properties for my database solution items:

database1.mdf: copy always
database1Dataset.xsd: do not copy
dataclasses1.dbml: do not copy

回答1:


database1.mdf=====> properties =======>copy output direction=copy always

This is why. You are editing a copy of the database each time you start a new debug session. Set it to do not copy and your updates will persist.



来源:https://stackoverflow.com/questions/6065914/save-data-to-db

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!