By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,261 Members | 1,674 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,261 IT Pros & Developers. It's quick & easy.

How do I take an array of objects and load it into a dataset datatable

P: n/a
I have an array of records pulled from a dateset linq query thgen parsed to contatecate first names and last names.
The new array looks like:

person(int1,0) <--- this holds person ID
person(int1,1) <--- this holds person name

I have the following code to create the new data table

Expand|Select|Wrap|Line Numbers
  2. dim data As New Dataset
  3. data.Tables.Add("people")
  4. data.Tables("people").Columns.Add("id")
  5. data.Tables("people").Columns.Add("name")

I am trying to use:

Expand|Select|Wrap|Line Numbers
  2. data.Tables("people").BeginLoadData()
  3. data.Tables("people").LoadDataRow(parsed(int1, 1), True)
  4. data.Tables("people").EndLoadData()
I think i am probably kinda close, but still far from the solution. The above doesn't work

Oct 16 '10 #1
Share this Question
Share on Google+
1 Reply

P: 46
Hi Original.

I don’t have a lot of experience with LINQ, but should your “parsed” verb be attached to the array?

data.Tables("people").LoadDataRow(parsed(int1, 1), True) S/B
data.Tables("people").LoadDataRow(person.parsed(in t1, 1), True)

Oct 19 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.