when tyring to hard-code databinding to a tree view in VS2005, the following code says that there is no definition for 'RunQuery' in the current context.
void PopulateCategories(TreeNode node)
{
SqlCommand sqlQuery = new
SqlCommand("Select * From Categories");
DataSet ResultSet;
ResultSet = RunQuery(sqlQuery);
if (ResultSet.Tables.Count > 0)
{
foreach (DataRow row in ResultSet.Tables[0].Rows)
{
TreeNode NewNode = new
TreeNode(row["CategoryName"].ToString(),
row["CategoryID"].ToString());
NewNode.PopulateOnDemand = true;
NewNode.SelectAction = TreeNodeSelectAction.Expand;
node.ChildNodes.Add(NewNode);
}
}
}
is this a VS2005 Beta bug or is ti fixable?
void PopulateCategories(TreeNode node)
{
SqlCommand sqlQuery = new
SqlCommand("Select * From Categories");
DataSet ResultSet;
ResultSet = RunQuery(sqlQuery);
if (ResultSet.Tables.Count > 0)
{
foreach (DataRow row in ResultSet.Tables[0].Rows)
{
TreeNode NewNode = new
TreeNode(row["CategoryName"].ToString(),
row["CategoryID"].ToString());
NewNode.PopulateOnDemand = true;
NewNode.SelectAction = TreeNodeSelectAction.Expand;
node.ChildNodes.Add(NewNode);
}
}
}
is this a VS2005 Beta bug or is ti fixable?