PC Review


Reply
Thread Tools Rate Thread

Array 2d into datatable

 
 
=?Utf-8?B?Sm9zZW1h?=
Guest
Posts: n/a
 
      18th Mar 2005
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.

--
Thanks
Regards.
Josema
 
Reply With Quote
 
 
 
 
=?UTF-8?B?TWFyY2luIEdyesSZYnNraQ==?=
Guest
Posts: n/a
 
      18th Mar 2005
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

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

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataTable or Array twq@hispeed.ch Microsoft VB .NET 5 14th Feb 2007 02:33 AM
How can I use real SQL on a DataTable? i.e. not array of rows using a filter... as in DataTable.Select Dan V. Microsoft C# .NET 3 1st Jul 2004 03:06 PM
Re: array or datatable AlexS Microsoft C# .NET 0 11th May 2004 09:41 PM
Re: array or datatable Ignacio Machin \( .NET/ C# MVP \) Microsoft C# .NET 0 11th May 2004 06:52 PM
Re: How do I get a datatable as an array Hermit Dave Microsoft ASP .NET 2 5th Feb 2004 04:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:30 PM.