Torna al Thread
PublicFunction DataRowToDataTable(ByVal arrDataRow As DataRow(), ByVal dtTarget As DataTable) As DataTable
'Controllo
If (arrDataRow.Length > 0) ThenIf (arrDataRow(0).ItemArray.Length <> dtTarget.Columns.Count) Then
Return dtTarget
EndIf
Dim drNew As DataRow = Nothing
ForEach dr As DataRow In arrDataRow
drNew = dtTarget.NewRow()
drNew.ItemArray = dr.ItemArray
dtTarget.Rows.Add(drNew)
Next
Return dtTarget
Else
ReturnNothing
EndIf
EndFunction