我正在尝试读取这样的ADOBD.Recordset对象(我的第一次,所以原谅我的"noobness":D):
Presentation.Category categorySvc = new Presentation.Category();
ADODB.Recordset categories = categorySvc.ListAll("BE", "DUE", "EN", 128);
foreach (var category in categories.Fields) // here is where I get the exception
{
// ...
}
Run Code Online (Sandbox Code Playgroud)
ListAll调用工作正常 - 我得到Recordset一些数据,我通过对对象执行QuickWatch确认.但是当代码到达categories.Fields时,我得到以下异常:
无法从程序集"TestCOMCalls,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null"加载类型"ADODB.FieldsToInternalFieldsMarshaler".
我用谷歌搜索了这个错误(或者只是通过'ADODB.FieldsToInternalFieldsMarshaler'找不到任何可以帮助我解决问题的东西).
我想知道,我错过了一个参考?除了正常的引用,我已经将这个添加到我的项目中:
ADODB Microsoft ActiveX数据对象2.5库C:\ WINDOWS\assembly\GAC\ADODB\7.0.3300.0__b03f5f7f11d50a3a\ADODB.dll
就像我说的那样,我以前从未这样做过,但通过谷歌搜索,我能够看到一些人这样做(foreach on the object.Fields),它似乎适合他们.
非常感谢任何帮助或方向:)
谢谢!