in

Dynamics User Group

Since 1995 - The Microsoft Dynamics Online User Community

How to pass Axapta Buffer Using Microsoft Business Connector From Vb.net to Axapta Method

Last post 07-01-2008 9:28 by prashant_shetake. 0 replies.
Page 1 of 1 (1 items)
Write a New Post Sort Posts: Previous Next
  • 07-01-2008 9:28

    How to pass Axapta Buffer Using Microsoft Business Connector From Vb.net to Axapta Method

    Below is the patch of code that is executed on the  click  event of the button.I am trying to Send the data table information from vb.net using microsoft business connector to axapta method as a parameter(Table Buffer).But following error occurs.

    Unable to cast object of type 'System.Data.DataTable' to type 'Microsoft.Dynamics.BusinessConnectorNet.AxaptaBuffer'. 

    is there any other solution to pass datatable infomation to axapta method as buffer ?? 

    code i have used :- 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

            Dim axRouteReference As AxaptaObject
           
    Dim Buffer As AxaptaRecord
            Try

                AxaptaObj = AxaptaLogon(Gbl_Company)

                            buffer=AxaptaObj.CreateAxaptaBuffer()    

                axRouteReference = AxaptaObj.CreateAxaptaObject("PwC_VB_Route")

                            Buffer=vgrdRouteLines.DataSource 

                Call axRouteReference.Call("UpdateDataRouteJournalLines ", Buffer)

                MsgBox("Done"

            Catch ex As XppException
               
    Call MsgBox(ex.Message)

            End Try

            AxaptaObj.Logoff()

            AxaptaObj = Nothing

        End Sub

    • Post Points: 5
Page 1 of 1 (1 items)


Copyright Dynamics User Group, 1995-2008, all rights reserved. This website and user group are independent and not affiliated with the Microsoft Corporation.