asp.net 1.1
I have two DataTables with identical structures I want to combine, as if
I had used UNION in the select statement. I know I could just loop
through and add rows from one table to the other but that seems like it
might be pretty inefficient. Is there a cleaner way or is looping my
best bet? Thanks!
Matt
Mark Rae - 30 May 2007 21:18 GMT
> I have two DataTables with identical structures I want to combine, as if I
> had used UNION in the select statement. I know I could just loop through
> and add rows from one table to the other but that seems like it might be
> pretty inefficient. Is there a cleaner way or is looping my best bet?
> Thanks!
http://www.google.co.uk/search?sourceid=navclient&aq=t&hl=en-GB&ie=UTF-8&rlz=1T4
GGIH_en-GBGB220GB220&q=DataTable+merge

Signature
http://www.markrae.net
Tim Van Wassenhove - 30 May 2007 21:44 GMT
MattB schreef:
> asp.net 1.1
>
[quoted text clipped - 3 lines]
> might be pretty inefficient. Is there a cleaner way or is looping my
> best bet?
What about using DataSet.Merge?

Signature
Tim Van Wassenhove - Read my mind <url:http://www.timvw.be/>
MattB - 30 May 2007 22:45 GMT
> asp.net 1.1
>
[quoted text clipped - 5 lines]
>
> Matt
Thanks to you both! I actually found a way to do this without having to
combine the tables, so the problem went away.
Matt
Mark Rae - 30 May 2007 23:26 GMT
> Thanks to you both! I actually found a way to do this without having to
> combine the tables, so the problem went away.
Are you going to share it with the group...?

Signature
http://www.markrae.net
MattB - 13 Jun 2007 21:20 GMT
>> Thanks to you both! I actually found a way to do this without having
>> to combine the tables, so the problem went away.
>
> Are you going to share it with the group...?
No. But only because it doesn't really apply to the original question.
Basically it boiled down to a better SQL query using UNION instead of
two distinct queries.
Matt