|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
create datatable from array of objects?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. -- Show quoteMiha Markic [MVP C#] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "hazz" <greghazz***@comcast.net> wrote in message news:%23nOGoIw3FHA.472@TK2MSFTNGP15.phx.gbl... > How can I do that? > Thank you. > -hazz > Thank you Miha! I could see the DataTable.Rows.Add requirement. I will
figure out now to create the table manually. -hazz Show quote "Miha Markic [MVP C#]" <miha at rthand com> wrote in message news:%23uY05Mw3FHA.2196@tk2msftngp13.phx.gbl... > 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" <greghazz***@comcast.net> wrote in message > news:%23nOGoIw3FHA.472@TK2MSFTNGP15.phx.gbl... >> How can I do that? >> Thank you. >> -hazz >> > > 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/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatatableclassloaddatarowtopic.asp I hope this helps, Cor Thank you Cor. The link was very helpful.
And I will pay close attention to my array/column value correspondence. thanks again. - Hazz Show quote "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message news:uyW3ixw3FHA.1416@TK2MSFTNGP09.phx.gbl... > 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/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatatableclassloaddatarowtopic.asp > > I hope this helps, > > Cor > |
|||||||||||||||||||||||