<?xml version="1.0"?> <Names> <Name> <First_Name>FN 1</First_Name> <Middle_Name>MN 1</Middle_Name> <Last_Name>LN 1</Last_Name> <Country_Code>001</Country_Code> <Area_Code> </Area_Code> <Phone_No> </Phone_No> <Email_Address>mail@email.com</Email_Address> <Address>Address 1</Address> </Name> <Name ID="2"> <First_Name>FN2</First_Name> <Middle_Name>Mn2</Middle_Name> <Last_Name>Ln2</Last_Name> <Country_Code>02</Country_Code> <Area_Code>002</Area_Code> <Phone_No>0002</Phone_No> <Email_Address>email@mail2.com</Email_Address> <Address> </Address> </Name> </Names>
Function Edit() As Boolean Try 'Dim xd As New XmlDocument() 'xd.Load(App_Path) 'Dim nod As XmlNodeList = xd.SelectNodes("//First_Name[. = '" & txtFName.Text & "']" & "/parent::node()/First_Name") 'If nod IsNot Nothing Then ' For Each node In nod ' 'nod.Item(0).ChildNodes(0).InnerText = txtMName.Text.Trim ' 'nod.Item(0).ChildNodes(1).InnerText = txtLName.Text.Trim ' Next 'End If Dim xd As New XmlDocument() xd.Load(App_Path) Dim nod As XmlNode = xd.SelectSingleNode("//First_Name[. = '" & txtFName.Text & "']" & "/parent::node()/First_Name") If nod IsNot Nothing Then nod.ChildNodes(0).InnerText = "33" nod.ChildNodes(1).InnerText = "333" End If Edit = True Catch ex As Exception MessageBox.Show(ex.Message) ctlStatus.Text = "Current State : " & ex.Message.ToString Return False End Try Return Edit End Function
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)