ExecuteNonQuery()不起作用 [英] ExecuteNonQuery() Not Working

查看:73
本文介绍了ExecuteNonQuery()不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

引用帖子: C#-ExecuteNonQuery()无法使用SQL Server CE

我将附加的Access数据库附加到我的项目中时遇到了同样的问题,确实我尝试插入记录,但是全部徒劳,它告诉我已插入记录,但未找到记录.

I have the same problem with an attached Access Database to my Project and indeed i try to Insert records but all in vain, it tells me that it's inserted but no records found..

以上文章讨论了问题及其原因,但我想了解更多有关解决方案的信息……我该如何解决此问题??

Well the above post discussed the problem and its cause but i want to know more about the solution... How Can i Solve this problem???

最好的问候,

Baher.

推荐答案

我想我找到了解决方案,在搜索了一段时间后,我做了以下更改:

I think I found out the Solution , after searching for sometime i did the following changes:

1-在解决方案资源管理器中,我更改了数据库的属性,即 复制到输出目录:始终 到 复制到输出目录:不复制

1- In the Solution Explorer I changed the property of my database which is Copy to Output Directory : always To Copy to output Directory : Do not Copy

2-在服务浏览器中,我右键单击我的数据库,然后将其连接修改为与bin文件夹中存在的数据库的连接.

2- In the Serve Explorer i right clicked my database and modified the Connection to it to the database which exists in my bin folder.

就这样...

希望有帮助

这篇关于ExecuteNonQuery()不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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