0

参考帖子:C# - ExecuteNonQuery() 不适用于 SQL Server CE

我在我的项目中附加了 Access 数据库时遇到了同样的问题,实际上我尝试插入记录但一切都是徒劳的,它告诉我它已插入但没有找到记录..

好吧,上面的帖子讨论了问题及其原因,但我想了解更多关于解决方案的信息......我该如何解决这个问题???

此致,

巴赫。

4

4 回答 4

1

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

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- In the Serve Explorer i right clicked my database and modified the Connection to it to the database which exists in my bin folder.

That's it...

Hope that it helps

于 2010-11-28T10:24:44.187 回答
0
  1. 在 C# 中执行时检查您的连接是否打开
  2. 检查您是否在 sql 中没有未提交的事务
于 2010-11-28T08:41:33.890 回答
0

你在使用交易吗?如果是,请确保您正在提交它或者您不会意外回滚

于 2010-11-28T09:54:35.653 回答
0

先生,我认为连接已经打开,因为查询没有抛出任何异常,w

先生,您的查询是什么样的?字符串表示,因为如果您有 WHERE 子句,并且该字段丢失,或者如果您正在更新,则 WHERE 子句不会抛出异常并会告诉您所有内容都已插入但可能没有,因为它已访问数据库并查看对于表,但没有找到任何变量,它只是通过....

于 2010-11-28T16:31:27.743 回答