Link to home
Start Free TrialLog in
Avatar of JCWEBHOST
JCWEBHOST

asked on

sort menu items from xml

Hey guys i have an menu and populating it from a data base

here the code in c#:

 
protected void Page_Load(object sender, EventArgs e)
    {
        DataSet ds = new DataSet();
        using (SqlConnection conn = new SqlConnection(connStr))
        {
            string sql = "Select id, title, parent_id, url from menu";
            SqlDataAdapter da = new SqlDataAdapter(sql, conn);
            da.Fill(ds);
            da.Dispose();
        }

        ds.DataSetName = "Menus";
        ds.Tables[0].TableName = "menu";
        DataRelation relation = new DataRelation("ParentChild", ds.Tables["menu"].Columns["id"], ds.Tables["menu"].Columns["parent_id"], true);

        relation.Nested = true;
        ds.Relations.Add(relation);

        xmlDataSource.Data = ds.GetXml();
    }

Open in new window


my problem is, how do to do a sort on the sub menus?

ASKER CERTIFIED SOLUTION
Avatar of Easwaran Paramasivam
Easwaran Paramasivam
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial