TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
KavithaMani K
NA
1
2.5k
Delete and Edit the xml file nodes
Nov 29 2012 12:39 AM
This is my input sample.xml
<users>
<user name='aaa' password='111' status='0' expireson='2012-12-31' createdon='2011-05-31'>
<user name='bbb' password='222' status='0' expireson='2012-12-31' createdon='2011-05-31'/>
<user name='ccc' password='333' status='0' expireson='2011-12-31' createdon='2011-05-31'/>
<user name='ddd' password='444' status='0' expireson='2011-12-31' createdon='2011-05-31'/>
</user>
I need to delele the user tag (name as 'aaa') also
I need to edit the expireson on the user tag(name as 'ddd')
I'm new to c# language. I dono how to do this.
My sample Code for delete:
XmlDocument doc = new XmlDocument();
doc.Load(sample.xml");
XmlElement elmRoot = doc.DocumentElement;
string xPath = "/users/user[@name='aaa']";
XmlNode findnode = elmRoot.SelectSingleNode(xPath);
elmRoot.RemoveAll();
doc.Save(sample.xml");
But not working.
For editing i don't have any idea.
Please any help me.
Reply
Answers (
2
)
Fixed records on detail section in Crystal report
find substring in combobox in vb.net