Question

What will the best way to pass a datatable data to unmanaged environments? (c++)

Ofer

Was it helpful?

Solution

I don't think there is a single best answer here.

One option is to export the database as XML and let your unmanaged code consume that. The main benefit of this approach is it is cheaper (development-wise) on the managed side and provides flexibility on the unmanaged side.

Otherwise you will need to provide your own marshaling of the data. This would be best down with C++/CLI code that could work with the dataset and convert it to a data structure that your unmanaged code understands.

We've done something similar in the past and it works, but is a fair amount of code to cover the general case.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top