Convert Array to DataTable Vb .Net

0

I have the following:

Dim array() as Object

I fill it with a:

webservice.execute(Parm1).ToArray

I want to pass that array to DataTable in a dynamic and efficient way.

    
asked by N. Zaldivar 07.07.2016 в 19:14
source

1 answer

0

You have two options:

  • Create the DataTable, and traverse the Array by adding rows to the DT.

  • Use the following function:

    Public Shared Function GetDataTableFromArray(ByVal array As Object()) As DataTable
        Dim dataTable As New DataTable()
        dataTable.LoadDataRow(array, True)
        Return dataTable
    End Function
    
  • answered by 07.07.2016 / 22:18
    source