Can we pass datatable as input to a C# DLL as a parameter ?

  • 14 January 2023
  • 5 replies

Badge +1

Hi Team,


I wanted to pass DataTable as input parameter to C# DLL. I am unable to find Datatable parameter in the parameter type. Is it possible to pass Datatable as an input?


Is there a workaround to pass a datatable as parameter?


DLL Parameter



Best answer by rbkadiyam 14 January 2023, 19:29

View original

5 replies

Userlevel 5
Badge +14

@anandc  check this article if it can help -

Badge +1

Thanks for sharing. This article mentions passing a list and then converting the list to Datatable. Can we directly pass datatable variable?

Userlevel 2
Badge +5

Hi @anandc ,

when i remember correct this is not possible just List and Dictionary.

Badge +2


It is supporting this data type only.



 There is one possible way. In Run Function you need to pass Datatable as String[,] as Input Parameter.

DLL Function arguments must be as below. and should return the multidimensional array.


you first need to convert this 2d array into datatable and after that perform required operation on that datatable and again convert it back to array.

it works.
reach out to me if you need help.