J
Joey Lee
Hi,
I am confused as what the DataSet Merge() function does.
Currently I have two datatable which was selected from different table in
mssql.
Now with both different datatable. there are unique keys which determine the
the relationship.
Ex
Table 1 Name - Employer
Fields - id, name, age
Values -
1, Joe, 80
2, Bob, 23
3, Fred, 40
Table 2 Name - Car
Fields - id, car, price
Values -
1, Ferrari, 1.0
2, Volvo, 0.8
Now, by using id as the relationship, doing a merge I would like to get
New Table
Values - id, name, age, id, car, price
1, Joe, 80, Ferrari, 1.0
2, Bob, 23, Volvo, 0.8
3, Fred, 40 , null, null
Is this possible? How do I go about doing this? Please note I cannot use a
join sql statement, as the values selected out has already been processed by
different complex business logic.
I have followed the example on this site
http://weblogs.sqlteam.com/davidm/archive/2004/01/20/748.aspx, which gives
me the result that i want(after tweaking it). However this requires looping
and extra coding to merge them up by parsing the rows of both table. Is
there a function in DataSet to do something like the above example?
Thanks
Joey
I am confused as what the DataSet Merge() function does.
Currently I have two datatable which was selected from different table in
mssql.
Now with both different datatable. there are unique keys which determine the
the relationship.
Ex
Table 1 Name - Employer
Fields - id, name, age
Values -
1, Joe, 80
2, Bob, 23
3, Fred, 40
Table 2 Name - Car
Fields - id, car, price
Values -
1, Ferrari, 1.0
2, Volvo, 0.8
Now, by using id as the relationship, doing a merge I would like to get
New Table
Values - id, name, age, id, car, price
1, Joe, 80, Ferrari, 1.0
2, Bob, 23, Volvo, 0.8
3, Fred, 40 , null, null
Is this possible? How do I go about doing this? Please note I cannot use a
join sql statement, as the values selected out has already been processed by
different complex business logic.
I have followed the example on this site
http://weblogs.sqlteam.com/davidm/archive/2004/01/20/748.aspx, which gives
me the result that i want(after tweaking it). However this requires looping
and extra coding to merge them up by parsing the rows of both table. Is
there a function in DataSet to do something like the above example?
Thanks
Joey