无法写入数据库。 [英] cannot write to database.

查看:213
本文介绍了无法写入数据库。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述
















我正在尝试使用c#开发软件来更新SQL数据库


 当我更新它正确更新的数据。


 当我关闭Visual Studio c#项目并再次打开它时,数据没有改变。


 问候,


  Mike。

解决方案

您可能正在使用app_data文件夹(对于Web应用程序)每次重建时都会覆盖数据库。


要确保始终更新,可以复制数据库并附加到SQL Express实例,而不是附加到应用程序中。


I'm trying to develop software to update a SQL database using c#

 When I updaate the data it updates correctly.

 When I close the Visual studio c#project and open it again the data has not changed.

 Regards,

 Mike.

解决方案

You're probably using the app_data folder (for a web application) and overwriting the database every time you rebuild.

To make sure you're always updating you can copy your database and attach to an SQL Express instance instead attaching within your application.


这篇关于无法写入数据库。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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