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#:
my problem is, how do to do a sort on the sub menus?
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();
}
my problem is, how do to do a sort on the sub menus?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.