karan_21584 0 Light Poster

in vb.net, how to check whether the attribute is existing or not... that is.......... i have an xml file and the content is as.....

<xs:element name="name" type="xs:string" minOccurs="0"/>
<xs:element name="sample">

my coding line is : "ans=xmlnode(k).Attributes.Item(1).Value"
when reading the above coding, the error "object reference not set to an istance of an object" is occuring....

HOW TO CHECK WHETHER THE NEXT ATTRIBUTE IS EXISTS OR NOT?
help me......thanks in advance

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.