本文介绍了VS2010中带有内置sql数据库的Probelm,带有c#的窗口应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在c#4.0中创建了一个窗口应用程序,我在VS2010中使用了内置的sql数据库(.mdf datbase).之前它工作正常.但是现在我注意到其中存在一个问题.
工作:
1)用户被添加到数据库,并通过插入新的一行被ExecuteNoQuery返回1确认.
2)然后再添加下一个用户,因为前一个用户ID为1,它检查最后一个ID,并将ID递增1.它也被成功添加.

3)搜索操作也可以正常工作.


但是,当我关闭应用程序时,没有任何内容保存在数据库中.我刷新数据库
之后也什么也没发生.
1
因此,当我重新启动应用程序时,用户ID再次从1开始.

在较早的时候将新数据库添加到项目中时,仅创建具有mdf和日志文件的数据库.但这一次它还会创建DrishyaDatabaseDataSet.xsc文件.(一旦删除它们,它们是否很重要)

I have created a window application in c# 4.0, i used inbuilt sql database (.mdf datbase) in VS2010. earlier it was working fine. But now i noticed a problem in it.
working:
1)user get added to the database, that is confirmed by ExecuteNoQuery return 1, as new one row is inserted.
2)Then next user is also added, as previous user id was 1, it check last id and increment id by 1. it also get successfully added.

3)Search operation also work properly.


But when i close the application, nothing get saved in database. I refresh database
after that also nothing happened.
1
So when i restart application, user id again start from 1.

When earlier add new database to project, only database with mdf and log file was created. But this time it also create DrishyaDatabaseDataSet.xsc files.(Once i deleted them , were they important)

推荐答案


这篇关于VS2010中带有内置sql数据库的Probelm,带有c#的窗口应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 07:28