Peter Kiers
asked on
error: Identifier expected
Hi,
I have this code where at 3 places I get the error: Identifier expected.
Who knows the answer to my problem and is willing to help me?
P.
I have this code where at 3 places I get the error: Identifier expected.
Who knows the answer to my problem and is willing to help me?
P.
public void LoadTree()
{
DataSet PrSet = PDataset("SELECT * FROM tree");
tvNotes.BeginUpdate();
tvNotes.Nodes.Clear();
foreach (DataRow dr in PrSet.Tables[0].Rows)
{
TreeNode n2 = new TreeNode();
TreeNode n = new TreeNode();
n2 = FindNode(dr.["Parent"].Value); <===========
n = tvNotes.Nodes.AddChild(n2,dr.["Name"].Value); <===========
n.ImageIndex = (dr.["ImageIndex"].Value); <===========
if (n.ImageIndex == FolderClose_Image_Index)
{
n.SelectedImageIndex = FolderOpen_Image_Index;
}
else
n.SelectedImageIndex = n.ImageIndex;
int p = (dr.["ID"].Value);
n.Text = Pointer(p);
}
tvNotes.EndUpdate();
}
ASKER
yes I have
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
n.ImageIndex = dr.["ImageIndex"].Value;
Does not work either
P.
Does not work either
P.
ASKER
I still get the message: Identifier espected
ASKER
This will do:
n.Text = dr["Name"].ToString().Trim ();
n.Text = dr["Name"].ToString().Trim
ASKER
Thank you for the help.
peter
peter
Ummm, wasn't the first response the correct answer then?
I know youve onlly posted a snippet, but FindNode is a member function of the treeview class.
you can only call it without a treeview object if youre inheriting from that class.
the three errors might thus be stemming from the fact that youre attempting to call FindNode as a global function. but ive no direct experience with this so apologies if im totally mistaken.
you can only call it without a treeview object if youre inheriting from that class.
the three errors might thus be stemming from the fact that youre attempting to call FindNode as a global function. but ive no direct experience with this so apologies if im totally mistaken.
n2 = FindNode(dr["Parent"].Valu