I have two datasets that are being returned from two separate stored procedures. I need to be able to merge these two datasets into one so that the resulting dataset can be used to populate a DataList. I tried the typical ds1.Merge(ds2, true), but the result was not correct (as you might have suspected) when it was bound to the DataList control. The correct data was returned, but not in the "unionized" form that I need. The first dataset contains 5 columns and the second contains 2 columns. The primary key that binds both of these together is Item Number.

Here is an example of what I am getting from the merge:

[Label] [Actual Value]

Material Cloth
Type ...some type
Description ...some description
Color Red
Item Number 1111
Quantity
Unit Price

Material
Type
Description
Color
Item Number
Quantity 5
Unit Price $1.00

What I need to have is this:

Material Cloth
Type ...some type
Description ...some description
Color Red
Item Number 1111
Quantity 5
Unit Price $1.00

Any help is greatly appreciated.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.