开发者

Could not load type 'ADODB.FieldsToInternalFieldsMarshaler' from assembly

开发者 https://www.devze.com 2023-03-09 20:07 出处:网络
I have the following code: MAPITable mt = rStores.MAPITable; Recordset rs = new Recordset(); rs = mt.ExecSQL(@\"SELECT EntryID开发者_如何学C, \"\"http://schemas.microsoft.com/mapi/proptag/0x0FF60102

I have the following code:

MAPITable mt = rStores.MAPITable;

        Recordset rs = new Recordset();
        rs = mt.ExecSQL(@"SELECT EntryID开发者_如何学C, ""http://schemas.microsoft.com/mapi/proptag/0x0FF60102"" As PR_INSTANCE_KEY from Name");

        while (!rs.EOF)
        {
            var fields = ((dynamic)rs.Fields);
            for (int f = 0; f < fields.Count; f++)
            {
                var field = fields[f];
                var name = field.Name;
                var value = field.Value;
            }
            Debug.Print(rs.Fields["EntryID"].Value);
            Debug.Print(rs.Fields["PR_INSTANCE_KEY"].Value);
            rs.MoveNext();

When I try to access the recordset fields, I get the aforementioned error in the subject. I saw the question posted here, but that did not help me.

UPDATE: Nevermind - workaround listed here


Unfortunately your link to the workaround is broken. Page Not found. I found the following workaround.

ADODB Properties from References: Embed Interop Types: false Copy local: true specific version (in English maybe isolated?): false

0

精彩评论

暂无评论...
验证码 换一张
取 消