PC Review


Reply
Thread Tools Rate Thread

create datatable from array of objects?

 
 
hazz
Guest
Posts: n/a
 
      1st Nov 2005
How can I do that?
Thank you.
-hazz


 
Reply With Quote
 
 
 
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      1st Nov 2005
You have to crete the table manually (perhaps by inspecing first row's
column types), but you can import data easily using DataTable.Rows.Add and
passing object array for a row at a time.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"hazz" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> How can I do that?
> Thank you.
> -hazz
>



 
Reply With Quote
 
hazz
Guest
Posts: n/a
 
      1st Nov 2005
Thank you Miha! I could see the DataTable.Rows.Add requirement. I will
figure out now to create the table manually. -hazz

"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:%(E-Mail Removed)...
> You have to crete the table manually (perhaps by inspecing first row's
> column types), but you can import data easily using DataTable.Rows.Add and
> passing object array for a row at a time.
>
> --
> Miha Markic [MVP C#]
> RightHand .NET consulting & development www.rthand.com
> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>
> "hazz" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> How can I do that?
>> Thank you.
>> -hazz
>>

>
>



 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      1st Nov 2005
Hazz,


The datatable.loaddatarow, makes from an array of values a datarow.
Be aware that the array of values in every seperate object has to fullfill
the rules about the columns.

http://msdn.microsoft.com/library/de...tarowtopic.asp

I hope this helps,

Cor


 
Reply With Quote
 
hazz
Guest
Posts: n/a
 
      1st Nov 2005
Thank you Cor. The link was very helpful.
And I will pay close attention to my array/column value correspondence.
thanks again.
- Hazz

"Cor Ligthert [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hazz,
>
>
> The datatable.loaddatarow, makes from an array of values a datarow.
> Be aware that the array of values in every seperate object has to fullfill
> the rules about the columns.
>
> http://msdn.microsoft.com/library/de...tarowtopic.asp
>
> I hope this helps,
>
> Cor
>



 
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 X array of objects cax Microsoft C# .NET 1 8th Apr 2006 02:16 PM
Howto iterate over objects stored in one column of a DataTable ----Or howto get an array, collection, ... of objects stored in one column ofa DataTable Gordian Microsoft ADO .NET 3 27th Jul 2005 01:58 PM
How to Create an Array of Objects =?Utf-8?B?UHJhYmh1ZGhhcyBQZXRlcg==?= Microsoft VB .NET 2 3rd Feb 2005 11:59 PM
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
how to Create array of objects John Haigh Microsoft C# .NET 3 6th Apr 2004 04:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:42 AM.