Hi,

I am trying to popluate skmMenu from db on page.load:

Dim custDA As SqlDataAdapter = New SqlDataAdapter("SELECT CATEGORYName as text, 
categoryid as url FROM CATEGORIES", oconn)

Dim orderDA As SqlDataAdapter = New SqlDataAdapter("SELECT ModelName as text, 
CATEGORYID as url FROM PRODUCTS", oconn)

oconn.Open()

Dim custDS As DataSet = New DataSet("menu")

custDA.Fill(custDS, "menuItem")

orderDA.Fill(custDS, "subMenu")

oconn.Close()

Dim custOrderRel As DataRelation = custDS.Relations.Add("CustOrders", 
custDS.Tables("menuItem").Columns("url"), custDS.Tables("subMenu").Columns("url"))

custOrderRel.Nested = True


' File paths

Dim strXsdPath As String = Server.MapPath("db_xml.xsd")

Dim strXmlPath As String = Server.MapPath("db_xml.xml")

'''' Write out schema to .xsd file and data to .xml file

custDS.WriteXmlSchema(strXsdPath)

custDS.WriteXml(strXmlPath, XmlWriteMode.IgnoreSchema)

'Bind to menu

Menu1.DataSource = Server.MapPath("db_xml.xml")

Menu1.DataBind()

--------- The resulting xml is as follows:

 <?xml version="1.0" standalone="yes" ?> 

- <menu>
-     <menuItem>
          <text>PARTS</text> 
          <url>51</url> 
-         <subMenu>
              <text>YELLOW SLD002</text> 
              <url>51</url> 
      </subMenu>
     </menuItem>
</menu>

However, I want the resulting xml to be as follows and not as above and I am not sure 
how to it in code:
<menu>
    <menuItem>
        <text>Parts</text>
        <subMenu>
            <menuItem>
                    <text>  YELLOW SLD002    </text>
             <menuItem>
       </subMenu>
    </menuItem>
</menu>




[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to