更改不会保存在SQL Server Compact 3.5数据库中 [英] Changes are not saved in SQL Server Compact 3.5 database

查看:68
本文介绍了更改不会保存在SQL Server Compact 3.5数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用C#2010创建了一个Windows应用程序,并且我使用的是SQL Server Compact Edition 3.5。

I created a windows application with C# 2010, and I'm using SQL Server Compact Edition 3.5.

我也使用了 DataSet 使用 TabelAdapter 和绑定导航来更改数据库,以添加/编辑/删除。

I'm also using a DataSet to change the DB with a TabelAdapter, and a bindingnavigat to add/edit/delete.

问题是:我可以在执行期间执行所有这些命令,可以在 DataGridView 中看到添加和编辑的行,但是当我转到服务器数据库时解决方案并验证我的数据,尚未完成任何活动!没有添加行!

The problem is : I can do all these commands during the execution, I can see the rows added and edited in a DataGridView, but when I go to server databases solution and verify my data, no event had been done !! no rows added !

推荐答案

您的数据库可能从某处/项目名称复制到某处/项目名称/ bin / Debug /。检查项目树中数据库文件的属性。应该有设置为始终复制的复制到输出目录属性。如果存在始终复制,则说明您的应用程序正在处理数据库复制。

Your database may be copied from somewhere/Projectname to somewhere/Projectname/bin/Debug/. Check properties on database file in your project tree. There should be "Copy to Output Directory" property that is set to "always copy". If there is "always copy" - your application is working on database copy.

阅读帮助中的复制到输出目录。

Read about "Copy to Output Directory" in help.

对该问题有更详细的解释:链接到MSDN social

There is more detailed explanation of that problem: link to MSDN social

(有关VB的问题,但它也适用于C#)

(question about VB, but it applies to C# too)

这篇关于更改不会保存在SQL Server Compact 3.5数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆