Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Merge the contents of 3 tables into 1 table

Status
Not open for further replies.

steve1rm

Programmer
Aug 26, 2006
255
0
0
GB
Hello,

I have one data table with fields SerialNo, manufacturer, and model. Called AllParts.

I have 3 other data tables (software, components, equipment) that have those same fields plus some extra fields.

I want to fill this allParts with the serialNo, manufacturer, and model from the other tables.

So allParts will contain rows from software, components, equipment

a bit like copying all the contents from the 3 tables and merging them into a single data table called allParts.

Can anyone help me with this.

Many thanks,

Steve
 
As this forum is for questions about VB6 and its interaction with various databases, you may do better if you post the question in the forum related to your database, whichever that is. In any of the databases that support some version of SQL the query should be simple. Read faq222-2244 for forum usage guidance

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Steve,

Are you asking how to do this in VB or just how to do this in general?

John, don't be so harsh!
 
It was in .Net 2005

Anyway i managed to find out how to do it.

Code:
dtAllCustomerPart.Merge(dtCustomersSoftware)
            dtAllCustomerPart.Merge(dtCustomersComponents)
            dtAllCustomerPart.Merge(dtCustomersEquipment)

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top