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
mahesh
NA
116
77.7k
Appending new tag and attribute values to the existing xml file through code behind
Jul 25 2011 6:57 AM
Dear All,
I want to append tag and attribute values to the existing xml file.Here is my code
Strpath = AppDomain.CurrentDomain.BaseDirectory.ToString & "data.xml"
Dim doc As XDocument = XDocument.Load(Strpath)
Dim xmlnode As XElement = doc.<Strpath>(0)
'Dim xmleleattr As XElement
Dim xmleleattr As XElement = _
<Student>
<Name>
<%= David %>
</Name>
<Address>
<%= Royal street %>
</Address>
<PhoneNumber>
<%= 98767896%>
</PhoneNumber>
<Email>
<%=
[email protected]
%>
</Email>
</Student>
xmlnode.Add(New XElement(xmleleattr)) // in this line i,m getting an error that object reference not set to an instance of an object.
xmlnode.Save(Strpath)
Thanks in advance.
Reply
Answers (
9
)
How to create dll in VB.NET
String