web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to Pass DataTable as parameter to C# method from X++?

(0) ShareShare
ReportReport
Posted on by 80

Hi,

I am having issue passing datatable as parameter to C# method from X++. I have performed several experiments only returning DataTable (Works),passing other primitive datatypes (Works) just not the DataTable or DataSet. 

I am using AX 2012 R3 CU8 and Visual Studio 2013.

Thanks in Advance.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    You have not provided enough information, for example are you using the Proxy approach, or Business Connector?

    BC uses AxaptaRecord, check the documentation msdn.microsoft.com/.../cc197126.aspx

    And for managed code it would be the specific table itself as a proxy within your project: msdn.microsoft.com/.../gg889166.aspx

    https://msdn.microsoft.com/en-us/library/gg889200.aspx

  • Salman Pervaiz Profile Picture
    80 on at

    I have made System.Data.DataTable in X++ and filled it with X++ Query to fetch some data from different tables. Then i am trying to pass that DataTable to C# method. C# method library is added to AOT that is why i am calling C# method from X++.

    Note: I am not using BC.

  • Vilmos Kintera Profile Picture
    46,149 on at

    Ok I see, it is the other way around than what I meant. Please paste your code, because it is hard to guess what is wrong.

    Or you could compare against some of these:

    stackoverflow.com/.../creating-a-datatable-in-x

    stackoverflow.com/.../passing-a-datatable-to-net-method-using-x

    You could marshal the .net errors as well in X++ to see what is wrong.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans