.NET Enum

rhnavc
Member Posts: 11
Hi,
I have to integrate the Recordset.Open method into NAV2016. The problem is that the Open method contains 5 input parameters from which 2 of type .NET Enum.
I defined the following variables:
RecordsetNet DotNet ADODB.RecordsetClass.'ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
CursorTypeEnumX DotNet ADODB.CursorTypeEnum.'ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
LockTypeEnumX DotNet ADODB.LockTypeEnum.'ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
and added the following code:
RecordsetNet := RecordsetNet.RecordsetClass;
CursorTypeEnumX := CursorTypeEnumX.adOpenDynamic();
LockTypeEnumX := LockTypeEnumX.adLockBatchOptimistic();
RecordsetNet.Open(
CommandNet,
ConnectionNet,
CursorTypeEnumX,
LockTypeEnumX,
-1
)
When I run the code I get the following error at CursorTypeEnumX level:
Cannot load an instance of the following .NET Framework object: assembly ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
I simply don't know how to instantiate the "Enum" variables, or is it something else? I would appreciate any help. Thanks.
I have to integrate the Recordset.Open method into NAV2016. The problem is that the Open method contains 5 input parameters from which 2 of type .NET Enum.
I defined the following variables:
RecordsetNet DotNet ADODB.RecordsetClass.'ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
CursorTypeEnumX DotNet ADODB.CursorTypeEnum.'ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
LockTypeEnumX DotNet ADODB.LockTypeEnum.'ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
and added the following code:
RecordsetNet := RecordsetNet.RecordsetClass;
CursorTypeEnumX := CursorTypeEnumX.adOpenDynamic();
LockTypeEnumX := LockTypeEnumX.adLockBatchOptimistic();
RecordsetNet.Open(
CommandNet,
ConnectionNet,
CursorTypeEnumX,
LockTypeEnumX,
-1
)
When I run the code I get the following error at CursorTypeEnumX level:
Cannot load an instance of the following .NET Framework object: assembly ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
I simply don't know how to instantiate the "Enum" variables, or is it something else? I would appreciate any help. Thanks.
0
Answers
-
You can substitute integers for those ENUMs - they are just parameters for that call that are sort of the equivalent of a NAV Option field - translating human-readable-names to integers.
The links below will take you to the list of name-integer mappings for those two enums.
https://msdn.microsoft.com/en-us/library/ms681771(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/ms680855(v=vs.85).aspxKyle Hardin - ArcherPoint0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions