Array 2d into datatable

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.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top