c# - XMLNODE: how can i select this node with attribute in my xml -
i have xml following structure
<student> <name fname="oliver"> </name> <name fname="de"> </name> <name fname="johnson"> </name> </student>
my code this:
//after loading xmldocument called xmlrecord
xmlnode row = xmlrecord.selectsinglenode("/student"); student.fname = row.selectsinglenode("name[fname]");
but not returning anything. pls best way select fname='johnson' node?
you want fname
attribute of first <name>
element, should write:
student.fname = row.selectsinglenode("name/@fname");
Comments
Post a Comment