gpt4 book ai didi

c# - 为什么我收到 'an unhandled exception of type system executionengineexception occurred in system data dll' 错误?

转载 作者:行者123 更新时间:2023-12-03 09:26:43 25 4
gpt4 key购买 nike

我正在为 SQL Server 集成服务编写自定义组件 (DLL),当尝试调试该组件时,我收到以下错误:

An unhandled exception of type 'System.ExecutionEngineException' occurred in System.Data.dll

当我在没有调试的情况下运行组件时,我没有收到此错误,并且在调试时引发此错误的代码段是此代码的第二行:

DataTable table;
table = new DataTable();

我尝试过运行这个: http://www.microsoft.com/en-au/download/details.aspx?id=30135但我仍然收到错误。

我还使用以下代码创建了一个简单的 Windows 窗体项目:

       DataTable table;
table = new DataTable();
table.Columns.Add("Dosage", typeof(int));
table.Columns.Add("Drug", typeof(string));
table.Columns.Add("Patient", typeof(string));
table.Columns.Add("Date", typeof(DateTime));

table.Rows.Add(25, "Indocin", "David", DateTime.Now);
table.Rows.Add(50, "Enebrel", "Sam", DateTime.Now);
table.Rows.Add(10, "Hydralazine", "Christoff", DateTime.Now);
table.Rows.Add(21, "Combivent", "Janet", DateTime.Now);
table.Rows.Add(100, "Dilantin", "Melanie", DateTime.Now);

并且我在调试时没有遇到错误。有谁知道我为什么会收到此错误以及如何调试我的代码?

最佳答案

通常这是由于编译 64 位程序集并尝试从 32 位进程使用它引起的,反之亦然。

关于c# - 为什么我收到 'an unhandled exception of type system executionengineexception occurred in system data dll' 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19460442/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com