For XML Explicit

dredge

New member
Joined
Jun 3, 2004
Messages
2
Location
Waco, TX
Programming Experience
5-10
not specifically for VB.NET development, but more SQL Server in general.

I have 2 tables that are many-to-many joined with a 3rd table:

Table1: Category
ID
Name

Table2: Product
ID
Name

Table 3: jCatProd
Cat_ID
Prod_ID


using a For XML Explicit query, I want to end up with an xml document that loooks like this:

<Category ID="" Name="">
<Products>
<Product ID="" Name="" />
<Product ID="" Name="" />
...
</Products>
</Category>
<Category ID="" Name="">
<Products>
<Product ID="" Name="" />
<Product ID="" Name="" />
...
</Products>
</Category>
...


I can set it up so that it comes out as
<Category>
<Product/>
<Product/>
</Category>

but I need the "Products" collection node to seperate my data into the layers that we require.

any help?

thanks.
 
Last edited:

Latest posts

Back
Top