473,326 Members | 2,680 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.

Question about the DataSet Merge.

Dear All,

Now i have a two dataset. they have same db structure and same columns and
same rows.

just the content is not same between them.

for example:

datagrid 1:

name,sex,order_quality
shenzhen benny,male,1000
shanghai allen,male,2000
hangzhou kevin,male,3000

datagrid 2:
name,sex,order_quality
shenzhen dragon,male,1000
shanghai leo,male,2000
hangzhou james,male,3000

sturcture is sames as the datagrid1.

now i want to merge them into one datagrid. how to do it? (i can't used
ado's Merge command, because it's not full fill my requirement).

i want the combination of these two grids into:

name,sex,order_quality,name1,sex1,order_quality1
shenzhen benny,male,1000,dragon,male,1000
shanghai allen,male,2000,leo,male,2000
hangzhou kevin,male,3000,james,male,3000

how to do it for the combination of the above?

because the Merge command is only for the data merger for vertical. not
for the horizontal. Now i must to used two for...loop...to finish this
requirement.

But I thinking whether i can get an easily ways to finish that. How is yor
suggestion?

Thanks,

Benny Ng

Nov 24 '06 #1
2 1281
When you do your query, simply change the names at that time for the 2nd
dataset, i.e., Select Name as Name1, Sex as Sex1, Order_Quality as
Order_Quality1. When you do your merge, since the columns are not identical,
the merge will be "horizontal" instead of vertical.

"Benny Ng" <be**********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Dear All,

Now i have a two dataset. they have same db structure and same columns
and
same rows.

just the content is not same between them.

for example:

datagrid 1:

name,sex,order_quality
shenzhen benny,male,1000
shanghai allen,male,2000
hangzhou kevin,male,3000

datagrid 2:
name,sex,order_quality
shenzhen dragon,male,1000
shanghai leo,male,2000
hangzhou james,male,3000

sturcture is sames as the datagrid1.

now i want to merge them into one datagrid. how to do it? (i can't used
ado's Merge command, because it's not full fill my requirement).

i want the combination of these two grids into:

name,sex,order_quality,name1,sex1,order_quality1
shenzhen benny,male,1000,dragon,male,1000
shanghai allen,male,2000,leo,male,2000
hangzhou kevin,male,3000,james,male,3000

how to do it for the combination of the above?

because the Merge command is only for the data merger for vertical. not
for the horizontal. Now i must to used two for...loop...to finish this
requirement.

But I thinking whether i can get an easily ways to finish that. How is
yor
suggestion?

Thanks,

Benny Ng

Nov 25 '06 #2
Thanks,Earl,

I think it's can be useful to me. But for me. Actually i need to used
execute two stored procedure to make it. (this two stored procedures is same
only the parameters is different.)

I'm still thinking.

Benny Ng

"Earl" <br******@newsgroups.nospamwrote in message
news:u9**************@TK2MSFTNGP04.phx.gbl...
When you do your query, simply change the names at that time for the 2nd
dataset, i.e., Select Name as Name1, Sex as Sex1, Order_Quality as
Order_Quality1. When you do your merge, since the columns are not
identical, the merge will be "horizontal" instead of vertical.

"Benny Ng" <be**********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>Dear All,

Now i have a two dataset. they have same db structure and same columns
and
same rows.

just the content is not same between them.

for example:

datagrid 1:

name,sex,order_quality
shenzhen benny,male,1000
shanghai allen,male,2000
hangzhou kevin,male,3000

datagrid 2:
name,sex,order_quality
shenzhen dragon,male,1000
shanghai leo,male,2000
hangzhou james,male,3000

sturcture is sames as the datagrid1.

now i want to merge them into one datagrid. how to do it? (i can't used
ado's Merge command, because it's not full fill my requirement).

i want the combination of these two grids into:

name,sex,order_quality,name1,sex1,order_quality1
shenzhen benny,male,1000,dragon,male,1000
shanghai allen,male,2000,leo,male,2000
hangzhou kevin,male,3000,james,male,3000

how to do it for the combination of the above?

because the Merge command is only for the data merger for vertical. not
for the horizontal. Now i must to used two for...loop...to finish this
requirement.

But I thinking whether i can get an easily ways to finish that. How is
yor
suggestion?

Thanks,

Benny Ng


Nov 27 '06 #3

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

Similar topics

2
by: Jeff Brown | last post by:
OK i removed all of my datasets to start fromo scratch again with another method. Is there a way i can create all my datasets in the MDI Parent form and reference them from child forms...
4
by: Al | last post by:
I have this scenario: 1. XML file with schema and data is created from SQL Server tables. XML file contains 6 tables, some of them have rows, some of them are empty. 2. XML file is given to the...
4
by: Al | last post by:
I have this scenario: 1. XML file with schema and data is created from SQL Server tables. XML file contains 6 tables, some of them have rows, some of them are empty. 2. XML file is given to the...
5
by: Franck | last post by:
how come unchanged always true even if data changed This code come from my saving button: ============================================ DataSet ds1 = new DataSet(); DataSet ds2 = new...
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...
1
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: 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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.