473,806 Members | 2,594 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Appending two data tables

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 method to do this, but I can't find one.

Thanks,
Mark

May 1 '06 #1
2 4846
Mark,

DataTable.Merge

http://msdn2.microsoft.com/en-us/lib...ble.merge.aspx

Be aware that this works conform the constrains of that datatable, therefore
adding will only be if the keys of the new one are really different and
higher than the old one.

I hope this helps,

Cor
"Mark" <Ma**@discussio ns.microsoft.co m> schreef in bericht
news:1D******** *************** ***********@mic rosoft.com...
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 method to do this, but I can't find one.

Thanks,
Mark

May 1 '06 #2
Merge works for .NET Framework 2.0. (I'm running 1.0)

I used the ImportRow method:

For i = 0 to dt.rows.count - 1
dtMain.ImportRo w(dt.Rows(i))
next i
Thanks for your comments

"Cor Ligthert [MVP]" wrote:
Mark,

DataTable.Merge

http://msdn2.microsoft.com/en-us/lib...ble.merge.aspx

Be aware that this works conform the constrains of that datatable, therefore
adding will only be if the keys of the new one are really different and
higher than the old one.

I hope this helps,

Cor
"Mark" <Ma**@discussio ns.microsoft.co m> schreef in bericht
news:1D******** *************** ***********@mic rosoft.com...
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 method to do this, but I can't find one.

Thanks,
Mark


May 2 '06 #3

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

Similar topics

2
11214
by: freeagent | last post by:
Help!! I am a complete Access newbie and I have to concatenate about 30 tables into one large table. All these tables have the same column headings as each other. For example, I have TABLE 1 which contains COLUMN1, COLUMN2, COLUMN3 ....
1
1814
by: Eli Sidwell | last post by:
I have an Access DB that contains 5 tables for the last 5 years. All 5 tables have the same structure. I wanted to keep each year separate for organizational purposes. But, I want to query all 5 tables with one query for an application. What would an query look like that uses all 5 tables as a source ? Should I create a view that inserts all 5 tables into a recordset ? (Wouldn't this be resource heavy ?)
1
1597
by: mar10 | last post by:
Hi - I have an Access 2000 database. Due to the way that tables flow and the way the user wants to enter data I'm trying to do the following - create a form that is NOT linked to a table. I would like to create a button that takes the data entered by the user and append it into a few tables. In doing some research on the web regarding this, earlier this week I found a reference to something similar and how to append the data to
7
2436
by: PC Datasheet | last post by:
Looking for suggestions ---- A database was designed for a national automobile inspection program. In it's simplest form, the database has two tables: TblOwner OwnerID <Year/Make/Model owned by owner, Owner name/address, etc) TblInspection InspectionID
2
2245
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 function to email authors when the Review Date has expired on their page. I've managed to now achieve a significant proportion of the work by writing out the details to an XML file and reading them back. However I'm a little stuck on Amending...
13
2408
by: Shwetabh | last post by:
Hi, I wanted to know if it is possible to do to append two tables into a third table. For example, consider these two tables Table 1 -------------------------------------------------------------- | Part_num | Prt_name | Desc1 | Desc2 | -------------------------------------------------------------- | PRT1 | PartA | abc | xyz |
7
9510
by: Daz | last post by:
Hi everyone! Is it possible to take a line of text like so: <tr><td>title1</td><td>title2</td><td>title3</td><td>title4</td></tr> And append it to a DOM node such as this: var nodeToAppendTo = document.getElementById('tbody');
3
1683
by: HSXWillH | last post by:
I've looked through the site and not found what I'm looking for here. I am not code-versed or anything like that so my skills are rudimentary at best. I'm using Access 03 on a Windows Vista environment. My question is about how to minimize data fields from large data-dumps in order to give myself the most recent recordset and to eliminate all older, out of date records. I have 7 bulk tables of data imported daily from a horse-racing text...
3
4470
by: manojspromantr | last post by:
I'm trying to append some data from one table to another table both the table structure are same. I have an attachments field in both tables but it seems that i cannot append the attachments from one table to the other. I get the following error when trying to just append the attachments field to the appropriate field: "An INSERT INTO query cannot contain a multi-valued field" I also get the following error when trying to append the...
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10620
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10369
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9187
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5682
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3851
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.