I'm trying to load a treeview. This code works in WinForms. In ASP I get the compile time error
which is not valid in the given context
Here's my code. It's erroring on "nodRoot.Nodes.Add(nodReport)" inside the ELSE.
private void _LoadReportNodes()
{
string Command = "SELECT * FROM ApexReports ORDER BY ParentId, Sequence";
DataSet dsTreeNodes = DataLayer.ExecuteQuery(Command);
string ReportTitle = string.Empty;
TreeNode nodRoot = null;
TreeNode nodReport = null;
foreach (DataRow Row in dsTreeNodes.Tables[0].Rows)
{
ReportTitle = Row["ReportTitle"].ToString();
if (Row["ParentId"] != DBNull.Value)
{
nodRoot = new TreeNode(ReportTitle);
tvwReports.Nodes.Add(nodRoot);
}
else
{
nodReport = new TreeNode(ReportTitle);
nodRoot.Nodes.Add(nodReport);
}
}
}
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people