| | |
Append Node to existiing XML file Using Vb.net
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Nov 2008
Posts: 27
Reputation:
Solved Threads: 0
Dear fiends,
Am Posting a Lot Nowadays.. Sorry if i had Disturbed you all...Hera my XML file..i Have to append a node below this..can some give me any idea how to do it..When i try..it is over writing the file
i need to append
<TaskName>
<name>abc</name>
<Value>3454</Value>
</TaskName>
following to the below code...can some one help me..with vb.net 1.1
<?xml version="1.0" encoding="UTF-8"?>
<TaskDetails>
<TaskName>
<name>qwerty</name>
<Value>12345</Value>
</TaskName>
</TaskDetails>
Am Posting a Lot Nowadays.. Sorry if i had Disturbed you all...Hera my XML file..i Have to append a node below this..can some give me any idea how to do it..When i try..it is over writing the file
i need to append
<TaskName>
<name>abc</name>
<Value>3454</Value>
</TaskName>
following to the below code...can some one help me..with vb.net 1.1
<?xml version="1.0" encoding="UTF-8"?>
<TaskDetails>
<TaskName>
<name>qwerty</name>
<Value>12345</Value>
</TaskName>
</TaskDetails>
•
•
Join Date: Nov 2008
Posts: 27
Reputation:
Solved Threads: 0
Hi all..
I have Solved this Thread By Myself..Here is the code if some one needs..
Public Sub xmlAppend(ByVal TaskId As String, ByVal Status As String)
Dim Tskid, stats As String
Tskid = TaskId.ToString.Trim
stats = Status.ToString.Trim
Dim myDoc As Xml.XmlDocument = New Xml.XmlDocument
myDoc.Load("d:\final.xml")
Dim root As XmlNode = myDoc.DocumentElement
Dim myElement As XmlElement = myDoc.CreateElement("Task")
Dim myName As XmlElement = myDoc.CreateElement("Name")
myName.InnerText = Tskid
Dim myString As XmlElement = myDoc.CreateElement("Satus")
myString.InnerText = stats
root.AppendChild(myElement)
myElement.AppendChild(myName)
myElement.AppendChild(myString)
myDoc.Save("d:\final.xml")
MsgBox("Xml File GeneratedUpdated")
End Sub
I have Solved this Thread By Myself..Here is the code if some one needs..
Public Sub xmlAppend(ByVal TaskId As String, ByVal Status As String)
Dim Tskid, stats As String
Tskid = TaskId.ToString.Trim
stats = Status.ToString.Trim
Dim myDoc As Xml.XmlDocument = New Xml.XmlDocument
myDoc.Load("d:\final.xml")
Dim root As XmlNode = myDoc.DocumentElement
Dim myElement As XmlElement = myDoc.CreateElement("Task")
Dim myName As XmlElement = myDoc.CreateElement("Name")
myName.InnerText = Tskid
Dim myString As XmlElement = myDoc.CreateElement("Satus")
myString.InnerText = stats
root.AppendChild(myElement)
myElement.AppendChild(myName)
myElement.AppendChild(myString)
myDoc.Save("d:\final.xml")
MsgBox("Xml File GeneratedUpdated")
End Sub
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: How do I play a .wav file from Resources?
- Next Thread: how to change file name?
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2005 2008 access account arithmetic array assignment basic binary bing box button buttons center check code component connectionstring convert cpu crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist editvb.net excel file-dialog firewall folder ftp hardcopy image images insert isnumericfuntioncall login math memory mobile ms mssqlbackend mysql navigate net networking opacity output passingparameters peertopeervideostreaming picturebox1 port printpreview problemwithinstallation project record reports" reuse save savedialog serial soap storedprocedure string tcp temp text textbox timer toolbox trim update updown useraccounts usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio web wpf





