I'm running into a very strange problem. The data that is listed in the watch window under
Treeview1 - base - base -dataSource - Data
does not reflect the data that is actually displayed on the webpage!
Here is the code, I appologize for its length
ConnectionStringSettings settings;
settings = System.Configuration.ConfigurationManager.ConnectionStrings["campgesherConnectionString"];
string connStr = settings.ConnectionString;
DataSet ds = new DataSet();
using (SqlConnection conn = new SqlConnection(connStr))
{
string sql = "Select MenuID, Text, Description, ParentID from Menu where cat like '"+ myCat +"'";
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["MenuID"],
ds.Tables["Menu"].Columns["ParentID"],
true);
relation.Nested = true;
ds.Relations.Add(relation);
//XmlDataSource1.Data = ds.GetXml();
if (Request.Params["Sel"] != null)
Page.Controls.Add(new System.Web.UI.LiteralControl("You selected " + Request.Params["Sel"]));
XmlDataSource myXML = new XmlDataSource();
myXML.TransformFile = "~/TransformXSLT.xsl";
myXML.XPath = "//topNode/*";
myXML.Data = ds.GetXml();
myXML.DataBind();
TreeView1.DataSource = myXML;
TreeView1.DataBind();
I'm not sure if there is anything that can be done, this is pretty strange.
But, if there is any input, any at all, awsome!
thanks