simple dataset question

  • Thread starter Thread starter suzy
  • Start date Start date
S

suzy

i have 2 tables in my dataset.

how can i perform an inner join between the 2 tables and bring back the
results in xml?

thanks.
 
I see - that explains why I couldn't find an example on the net!

Any idea how I could solve the following XML/dataset problem then?:

I have 2 DB tables (Orders, Customers) and would like to return a list of
orders (together with the associated customer that made each order).

If I do my inner join query in the stored procedure and load this into a
dataset, then the .GetXml() method returns a single hierarchy of data. How
can I make the dataset return nested data (ie: customer as a child node of
order).

Thanks.
 
Suzy,

Change your stored proc to either do a join, and return only data from teh
first table, or use a subquery.
 
Kathleen,

I can do that and it works, but the .GetXml method will return the XML in a
single hierarchy.

How could I make it return a nested hierarchy so customers were children of
orders.?

Thanks
 
I have a way out what you can do is Query the customers table by giving the
select statement as
select * from Customers where customerid in (select distinct customerid from
orders)

This would retrieve only those customers which have orders then you can the
desired results

HTH.
 
Back
Top