C/Front Problems in Visual Basic .NET with FieldNoArray and

wdaurer
Member Posts: 2
Hi,
I'm using CFront in my Visual Basic .net Application.
I'm accessing Navision on a Microsoft SQL 2000 Server
Dataaccess to normal Datafields work with no problem.
but I'm having Problems with the Calcfields. I tried almost every notation for the FieldNoArray and CalcFields Functions. I always get the same Exception:
please help
best Regards
Wolfgang Daurer
here is the Sample Code:
I'm using CFront in my Visual Basic .net Application.
I'm accessing Navision on a Microsoft SQL 2000 Server
Dataaccess to normal Datafields work with no problem.
but I'm having Problems with the Calcfields. I tried almost every notation for the FieldNoArray and CalcFields Functions. I always get the same Exception:
=========================================================== System.Runtime.InteropServices.COMException (0x80020005): Typkonflikt. at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData) at CFRONTLib.CFRONTClass.FieldNoArray(Int32 hTable, Object& FieldNameArray) at testCFRONT.Form1.Form1_Load(Object sender, EventArgs e) in D:\ProgrammierungVB\testCFRONT\testCFRONT\Form1.vb:line 78 ===========================================================what can be wrong?
please help
best Regards
Wolfgang Daurer
here is the Sample Code:
Dim cf As New CFRONTClass cf.CFrontDllName = "cfrontsql" cf.StopOnAllExceptions = False cf.ConnectServerAndOpenDatabase("NDBCS", "testserver", "Named Pipes", "testdb", 0, False, False, "sa", "") cf.OpenCompany("TestCompany") Dim tableref As Integer cf.OpenTable(tableref, cf.TableNo("Project")) Dim hrec As Integer = cf.AllocRec(tableref) If cf.FindRec(tableref, hrec, "-") Then Do '*** Project Number Dim val As Object = cf.GetFieldData(tableref, hrec, 1) Trace.Write(val.ToString + " ") '*** Project Name val = cf.GetFieldData(tableref, hrec, 2) Trace.Write(val.ToString + " ") '*** Customer Name from Calcfield Dim FieldNameArray() As Object = {"Name"} Dim array As Object = FieldNameArray '*** the Following Line has the Error: Dim SumFieldNoList As Object = cf.FieldNoArray(tableref, array) cf.CalcFields(tableref, hrec, SumFieldNoList) val = cf.GetFieldData(tableref, hrec, 58) Trace.WriteLine("[" + val.ToString + "]") Loop While cf.NextRec(tableref, hrec, 1) > 0 End If cf.FreeRec(hrec) cf.CloseTable(tableref) cf.CloseCompany() cf.CloseDatabase() cf.DisconnectServer()[/b]
0
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