|
-
December 27th, 2011, 11:55 AM
#1
Writing Data
Well Can Anybody help me write a vb.net code to make an xml having such data -
<Rule count="1">
<time filename="1" holder="abc" handler="xyz" gross="pqr"></time>
</Rule>
I'm a beginner at vb.net and felt it was quite easy than others. Got recommended about this site.........so please help
-
December 27th, 2011, 12:29 PM
#2
Re: Writing Data
Might help if you wanted to learn how to use VB.Net...
Also, if you search for VB.Net XML CODE, you'll find such things. I prefer LINQ to XML
http://www.hookedonlinq.com/LinqToXM...eOVerview.ashx
Had to change the C# into VB.Net (in RED)
Code:
Dim xml as XElement = new XElement("contacts",
new XElement("contact",
new XAttribute("contactId", "2"),
new XElement("firstName", "Barry"),
new XElement("lastName", "Gottshall")
),
new XElement("contact",
new XAttribute("contactId", "3"),
new XElement("firstName", "Armando"),
new XElement("lastName", "Valdes")
)
);
Console.WriteLine(xml);
<contacts>
<contact contactId="2">
<firstName>Barry</firstName>
<lastName>Gottshall</lastName>
</contact>
<contact contactId="3">
<firstName>Armando</firstName>
<lastName>Valdes</lastName>
</contact>
</contacts>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|