且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Sql Compact 随机产生 AccessViolationException

更新时间:2023-02-26 19:06:31

仅仅因为你设置了一个连接到 command.Connection 并不意味着它被设置了.

Just because you set a connection to command.Connection does not mean it is set.

command.Connection = connection;
command.Connection.GetHashCode() == connection.GetHashCode(); // may return false.

这就是问题的原因.可以通过使用 connection.CreateCommand();

This is the cause of the problem. Can be corrected by using connection.CreateCommand();