473,326 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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

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
  1.  
  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")
  6.  
  7.  

I am trying to use:

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

Thanks
Oct 16 '10 #1
1 1036
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)

Dave
Oct 19 '10 #2

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

Similar topics

23
by: Eva | last post by:
Hi i am trying to insert a new row into one of my datatabels that i have in my dataset when a button is clicked. here is my code Dim ClientInsRow As DataRow = dtClient.NewRo ...
2
by: Marty McDonald | last post by:
I have an array of objects (my own custom class). I'm trying to convert that array to a dataset. So I serialize the array to XML, then try to load the XML to a dataset. MemoryStream mem = new...
10
by: Bernie Yaeger | last post by:
I have a need to add a primary key to a dataset/datatable. How can this be done using a standard oledb data provider? Tx for any help.
1
by: Ramakrishnan Nagarajan | last post by:
Hi, I am converting Excel data into a Dataset in C#. There are around 24 columns in the Excel Sheet. First I tried to insert one row with correct values in the Excel sheet. i.e. for text columns...
2
by: Ronald S. Cook | last post by:
Hi, I need to open an Excel file from within my ASP.NET app and read data. I'm guessing the most like format in ASP.NET would be a DataTable. Regardles,, how do I get the data into my ASP.NET...
1
by: crackLab | last post by:
I Want to copy somes columns from a new datatable with data... DataTable drTable = new DataTable(); THERE'S THE LINE TO COPY THE STRUCTURE OF THE DATASET INTO THE DATATABLE drTable =...
6
by: marylipscomb | last post by:
I am using VB.NET. I am trying to connect a button so that when it is clicked the gridview pops up the data. Partial Class Switchboard Inherits System.Web.UI.Page Protected Sub...
2
by: Mr. Arnold | last post by:
I am working a C# project that uses what's in the subject. I kind of have the basics down on reading the table data. I don't use the above methods of data access or persistence, but I am stuck...
1
by: Daniel Jeffrey | last post by:
..Net 2.0 VStudio 2005 C# I know this is going to seem like a strange question, as even I am sure I have missed something - but I cant find it. I want a simple event on any of the objects...
3
by: ASPnewb1 | last post by:
I am currently filling a dataTable then adding this table to a dataset, setting the dataset to the Gridview's datasource. If I set the Gridview to generate columns automatically it will fill the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.