Array 2d into datatable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

How could i pass an array2d into a datatable?.

Has Datatable class a direct method to do that?

I try to use LoadRow method for each row in the array2d but doesnt work.
 
Hi Josema,

I found that sample in .NET docs... and HTH:

public static void PrintValues( Array myArr, char mySeparator ) {
System.Collections.IEnumerator myEnumerator = myArr.GetEnumerator();
int i = 0;
int cols = myArr.GetLength( myArr.Rank - 1 );
while ( myEnumerator.MoveNext() ) {
if ( i < cols ) {
i++;
} else {
Console.WriteLine();
i = 1;
}
Console.Write( "{0}{1}", mySeparator, myEnumerator.Current );
}
Console.WriteLine();
}

cheers!
Marcin
 
Back
Top