473,399 Members | 3,302 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,399 software developers and data experts.

appending rows to datatable

Hi all,

This is the way to append the rows from one datatable into another with the
same schema.

Here Temp and Temp1 are the datatables

For Each rows As DataRow In tempTable.Rows
Temp1 .NewRow()
Temp1 .ImportRow(rows)
Next

-Vignesh.S
Nov 16 '05 #1
2 14993
check out ItemArray on the DataRow class

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemdatadatarowclassitemarraytopic.asp

something like:

foreach(Datarow row in Table1.Rows)
{
DataRow newRow = Table2.NewRow();
newRow.ItemArray = row.ItemArray;
}

--
HTH

Ollie Riches
http://www.phoneanalyser.net

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a programmer
helping programmers.

"shankar" <sh*****@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
Hi all,

This is the way to append the rows from one datatable into another with the same schema.

Here Temp and Temp1 are the datatables

For Each rows As DataRow In tempTable.Rows
Temp1 .NewRow()
Temp1 .ImportRow(rows)
Next

-Vignesh.S

Nov 16 '05 #2
should have been

foreach(Datarow row in Table1.Rows)
{
DataRow newRow = Table2.NewRow();
newRow.ItemArray = row.ItemArray;

Table2.Rows.Add(newRow);
}

Ollie Riches
"Ollie Riches" <ol**********@phoneanalser.net> wrote in message
news:ux**************@TK2MSFTNGP12.phx.gbl...
check out ItemArray on the DataRow class

http://msdn.microsoft.com/library/de...us/cpref/html/ frlrfsystemdatadatarowclassitemarraytopic.asp

something like:

foreach(Datarow row in Table1.Rows)
{
DataRow newRow = Table2.NewRow();
newRow.ItemArray = row.ItemArray;
}

--
HTH

Ollie Riches
http://www.phoneanalyser.net

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a programmer
helping programmers.

"shankar" <sh*****@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
Hi all,

This is the way to append the rows from one datatable into another with

the
same schema.

Here Temp and Temp1 are the datatables

For Each rows As DataRow In tempTable.Rows
Temp1 .NewRow()
Temp1 .ImportRow(rows)
Next

-Vignesh.S


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: jurson | last post by:
Hello, I remove row from DataTable. It works ok, the row is removed from collection. It should be marked as 'detached'. Am I right? Then I try to retrieve 'detached' rows using the code shown...
2
by: tony.collings | last post by:
I started a thread here : http://groups.google.co.uk/group/microsoft.public.cmserver.general/browse_thread/thread/29d63077144004a9/c3888efdcb7338f6?hl=en#c3888efdcb7338f6 About creating an Email...
1
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple...
7
by: GaryB | last post by:
I have an untyped datatable that has financial numbers and controls that were populated by code (not a simple fill from a DA). Now I want to insert subtotals into it. I wrote a sub to do so that...
5
by: Geoff Jones | last post by:
Hi Suppose we have an array of DataRows e.g. Dim drMyRows() As DataRow = myTable.Rows(0).GetChildRows("PricesCompany") generated via a relationship. The question I have is this. Isn't...
1
by: Lars E | last post by:
Hi all I have a small problem. I have a datatable with 8 columns. But it is only data in 5 of the columns. Data for the remaing 3 columns is in another dataset. I Want to run trough the...
2
by: Mark | last post by:
Hi - I'm looking for a code sample that will let me append a data table to a second master data table. You can assume that the tables' structures are identical. Seems like there should be a...
3
by: Niyazi | last post by:
Hi all, I have a dataTable that contains nearly 38400 rows. In the dataTable consist of 3 column. column 1 Name: MUHNO column 2 Name: HESNO Column 3 Name: BALANCE Let me give you some...
3
by: Rich | last post by:
Hello, I am populating a datagridview from a datatable and filtering the number of rows with a dataview object. Is there a way to retrieve the rows displayed by the datagridview into a separate...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.