When searching for record(s), I retrieve the ID(s) data of LinkA.xml, named LinkID2 (Part A), I know how to add new records in the Link.xml when adding using the code below(Part B). How do I modify the code in Part B, to save the data for LinkID2 instead
of adding a new record?
Code To retreive Data and save ID of records found:
' create a new XML Document object for each XML file
Dim xdDonor As New Xml.XmlDocument
Dim xdLink As New Xml.XmlDocument
Dim xdReceiver As New Xml.XmlDocument
' load all of the XML documents
xdDonor.Load(Server.MapPath("~/App_Data/Donor.xml"))
xdLink.Load(Server.MapPath("~/App_Data/Link.xml"))
xdReceiver.Load(Server.MapPath("~/App_Data/Receiver.xml"))
' Extract the ReceiverID and DonorID values from the current node
Dim ReceiverID As String
Dim DonorID As String
Dim Link_ID As String
Dim DonorID2 As String
Dim Name As String
Dim ReceiverID2 As String
dtReceiver = New DataTable
dtReceiver.Columns.Add("ReceiverID", GetType(String))
dtReceiver.Columns.Add("Name", GetType(String))
dtDonor = New DataTable
dtDonor.Columns.Add("DonorID", GetType(String))
dtDonor.Columns.Add("Name", GetType(String))
MsgBox(C1Country.SelectedItem.Value)
' This outer loop will iterate over the Link file where the ReceiverID node is equal to our search criteria
For Each xnLink As Xml.XmlNode In xdLink.SelectNodes("/Root/Link[ReceiverID='" & C1Country.SelectedItem.Value & "']")
Link_ID = xnLink.SelectSingleNode("Link_ID").InnerText
ReceiverID = xnLink.SelectSingleNode("ReceiverID").InnerText
DonorID = xnLink.SelectSingleNode("DonorID").InnerText
' Perform another similar search based upon the Donor XML file
For Each xnDonor As Xml.XmlNode In xdDonor.SelectNodes("/Root/Donor[DonorID='" & DonorID & "']")
DonorID2 = xnDonor.SelectSingleNode("DonorID").InnerText
Name = xnDonor.SelectSingleNode("Name").InnerText
dtDonor.Rows.Add({DonorID2, Name})
Next
dtLinkID = New DataTable
dtLinkID.Columns.Add("Link_ID", GetType(String))
' Perform yet another practically identical search on the Receiver XML file
For Each xnReceiver As Xml.XmlNode In xdReceiver.SelectNodes("/Root/Receiver[ReceiverID='" & ReceiverID & "']")
' Extract the ReceiverID and Name values from the current node
ReceiverID2 = xnReceiver.SelectSingleNode("ReceiverID").InnerText
Name = xnReceiver.SelectSingleNode("Name").InnerText
dtReceiver.Rows.Add({ReceiverID2, Name})
Next
' Extract the Link_ID avalues from the current node
LinkID2 = xnLink.SelectSingleNode("Link_ID").InnerText
dtLinkID.Rows.Add({LinkID2})
****************************************************************************************
Part B:
Code to Add new records in Link.xml file
Dim xyz() As String = New String() {"Donor", "Receiver", "Manufacturer"}
Dim searchIdFixDonor As String = Nothing
Dim searchIdFixReceiver As String = Nothing
Dim searchIdFixManufacturer As String = Nothing
Dim i As Integer
i = 0
For i = 0 To 2
Dim curXYZ = xyz(i)
Dim MyFix As XDocument = XDocument.Load(Server.MapPath("~/App_Data/" & curXYZ & ".xml"))
Dim xid As String
xid = curXYZ & "_ID"
Dim LargestFixID = (From el In MyFix.Descendants(curXYZ & "Table") Select CInt(el.<xid>.Value)).ToList
LargestFixID.Sort()
Dim xtable As String
xtable = curXYZ & "Table"
Dim xcontrol1 As C1ComboBox = DirectCast(MultiView1.FindControl("C1" & curXYZ), C1ComboBox)
Dim CheckForItemFix = (From el In MyFix.Descendants(xtable).Elements(curXYZ) Select el.Value).ToList
If Not CheckForItemFix.Contains(xcontrol1.Text) Then
MyFix.Save(Server.MapPath("~/App_Data/" & curXYZ & ".xml"))
If curXYZ = "Donor" Then
searchIdFixDonor = LargestFixID.Count() + 1
End If
If curXYZ = "Receiver" Then
searchIdFixReceiver = LargestFixID.Count() + 1
End If
If curXYZ = "Manufacturer" Then
searchIdFixManufacturer = LargestFixID.Count() + 1
End If
End If
Dim searchFix As String = xcontrol1.Text
Dim domFix As New XmlDocument()
Dim listFix As XmlNodeList = domFix.SelectNodes("//" & xtable)
If CheckForItemFix.Contains(xcontrol1.Text) Then
For Each node As XmlNode In listFix
If node(curXYZ).InnerText.Equals(searchFix) Then
If curXYZ = "Donor" Then
searchIdFixDonor = node(xid).InnerText
End If
If curXYZ = "Receiver" Then
searchIdFixReceiver = node(xid).InnerText
End If
If curXYZ = "Manufacturer" Then
searchIdFixManufacturer = node(xid).InnerText
End If
Exit For
End If
Next
End If
'**************************************************************************************************************************
'Add data to Link File
Dim MyDocLink As XDocument = XDocument.Load(Server.MapPath("~/App_Data/LinkA.xml"))
Dim MyDocLinkSSADB As XDocument = XDocument.Load(Server.MapPath("~/App_Data/LinkSSADB.xml"))
Dim LinkID = (From el In MyDocLink.Descendants("LinkA") Select CInt(el.<LinkAID>.Value)).ToList
LinkID.Sort()
Dim xNewLink As XElement = New XElement("LinkA")
xNewLink.Add(New XElement("LinkAID", (LinkID.Last() + 1)))
If i = 2 Then
MyDocLink.Root.Add(New XElement("LinkA", New XElement("LinkAID", (LinkID.Last() + 1)), New XElement("Donor_ID", searchIdFixDonor), New XElement("Receiver_ID", searchIdFixReceiver), New XElement("Manufacturer_ID", searchIdFixManufacturer))
MsgBox("Data was Added")
End If
Next
You should first check whether there exists a node in your xml contents and then fetch it out, in the end change its Value and call Save for XDocument. Sample like this:
XDocument doc = XDocument.Load("xxx.xml");
var result = doc.Descedants("Your Tag Name Here").FirstOrDefault();
if(result!=null)
{
result.Value = "new value here";
doc.Save("Your path here");
}
I am trying the approach below but I'm running into a few difficulties, first withthe line below.
Dim nodeList As XmlNodeList = xmlDoc.SelectNodes("/LinkTable/LinkID[@ID='01']"
When I seach and find a record to amend, I retreive the ID value (LinkID2) with the code in my first post; How do I pass LinkID2 to the code:
Dim nodeList As XmlNodeList = xmlDoc.SelectNodes("/LinkTable/LinkID[@ID='01']")
Dim nodeList As XmlNodeList = xmlDoc.SelectNodes("/LinkTable/LinkID[@LinkID2]") ?
Example of Link.mll format:
<Root>
<LinkTable>
<LinkID>1</LinkID>
<ManufacturerID>1</ManufacturerID>
<ReceiverID> 3</ReceiverID>
<DonorID>4</DonorD>
</LinkTable>
<LinkTable>
PartA:
Code to retreive values is working OK:
Dim xyz() As String = New String() {"Donor", "Receiver", "Manufacturer"}
Dim searchIdFixDonor As String = Nothing
Dim searchIdFixReceiver As String = Nothing
Dim searchIdFixManufacturer As String = Nothing
Dim i As Integer
i = 0
For i = 0 To 2
Dim curXYZ = xyz(i)
Dim MyFix As XDocument = XDocument.Load(Server.MapPath("~/App_Data/" & curXYZ & ".xml"))
Dim xid As String
xid = curXYZ & "_ID"
Dim LargestFixID = (From el In MyFix.Descendants(curXYZ & "Table") Select CInt(el.<xid>.Value)).ToList
LargestFixID.Sort()
Dim xtable As String
xtable = curXYZ & "Table"
Dim xcontrol1 As C1ComboBox = DirectCast(MultiView1.FindControl("C1" & curXYZ), C1ComboBox)
Dim CheckForItemFix = (From el In MyFix.Descendants(xtable).Elements(curXYZ) Select el.Value).ToList
If Not CheckForItemFix.Contains(xcontrol1.Text) Then
MyFix.Save(Server.MapPath("~/App_Data/" & curXYZ & ".xml"))
If curXYZ = "Donor" Then
searchIdFixDonor = LargestFixID.Count() + 1
End If
If curXYZ = "Receiver" Then
searchIdFixReceiver = LargestFixID.Count() + 1
End If
If curXYZ = "Manufacturer" Then
searchIdFixManufacturer = LargestFixID.Count() + 1
End If
End If
Dim searchFix As String = xcontrol1.Text
Dim domFix As New XmlDocument()
Dim listFix As XmlNodeList = domFix.SelectNodes("//" & xtable)
If CheckForItemFix.Contains(xcontrol1.Text) Then
For Each node As XmlNode In listFix
If node(curXYZ).InnerText.Equals(searchFix) Then
If curXYZ = "Donor" Then
searchIdFixDonor = node(xid).InnerText
End If
If curXYZ = "Receiver" Then
searchIdFixReceiver = node(xid).InnerText
End If
If curXYZ = "Manufacturer" Then
searchIdFixManufacturer = node(xid).InnerText
End If
Exit For
End If
Next
End If
Part B:
' Code to Amend Link file needs some modification to retreive proper LinkID data
Dim xmlDoc As New XmlDocument()
xmlDoc.Load(Server.MapPath("Link.xml"))
Dim nodeList As XmlNodeList = xmlDoc.SelectNodes("/Link/LinkID[LinkID2])?
' update Manufacturer
nodeList(0).ChildNodes(0).InnerText = searchIdFixManufacturer
' update Receiver
nodeList(0).ChildNodes(1).InnerText = searchIdFixReceiver
' update Donor
nodeList(0).ChildNodes(2).InnerText = searchIdFixDonor
' Don't forget to save the file
xmlDoc.Save(Server.MapPath("Link.xml"))
Msgbox("XML File update")
Secondly, when I find multiple records, How do I keep track of the correct LinkID2 value as I move to Next Previous records in order to update the correct records in my link.xml file? For example, As I move through each node of my individual xml files (Manufacturer,
Receiver, Donor), how do I keep track of the correct LinkID2? Below is the code I'm using to move through the Donor records, is there a way to follow a similar approach to keep track of LinkID2?
Protected Sub Next_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Next.Click
dtDonor = Session("dtDonor")
currentIndex = Session("CurrentIndex")
If currentIndex > 0 Then
currentIndex -= 1
Session("CurrentIndex") = currentIndex
CmbDonor.Text = dtDonor.Rows(currentIndex).Item("Name")
End If
End Sub
Protected Sub Previous_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Previous.Click
dtDonor = Session("dtDonor")
currentIndex = Session("CurrentIndex")
If dtDonor.Rows.Count > 0 Then
currentIndex = 0
Session("CurrentIndex") = currentIndex
CmbDonor.Text = dtDonor.Rows(currentIndex).Item("Name")
End If
What do you mean by Your Real LinkID2? Do you mean my equation should be as follows?
Dim nodeList As XmlNodeList = xmlDoc.SelectNodes("/LinkTable/LinkID[@LinkID=LinkID2]")
Yes,I mean this what you've mentioned and I've referred above。
vcharles
How do I search for the latest LinkID2
Your question isn't very clear——What do you mean by saying——latest LinkID2?You mean the biggest number of LinkID2 or soemthing?What condition you can tell what is the latest LinkID2?
vcharles
Member
76 Points
76 Posts
Help with amending Link.xml file
Nov 27, 2011 11:44 AM|LINK
Hello,
When searching for record(s), I retrieve the ID(s) data of LinkA.xml, named LinkID2 (Part A), I know how to add new records in the Link.xml when adding using the code below(Part B). How do I modify the code in Part B, to save the data for LinkID2 instead of adding a new record?
Code To retreive Data and save ID of records found:
' create a new XML Document object for each XML file
Dim xdDonor As New Xml.XmlDocument
Dim xdLink As New Xml.XmlDocument
Dim xdReceiver As New Xml.XmlDocument
' load all of the XML documents
xdDonor.Load(Server.MapPath("~/App_Data/Donor.xml"))
xdLink.Load(Server.MapPath("~/App_Data/Link.xml"))
xdReceiver.Load(Server.MapPath("~/App_Data/Receiver.xml"))
' Extract the ReceiverID and DonorID values from the current node
Dim ReceiverID As String
Dim DonorID As String
Dim Link_ID As String
Dim DonorID2 As String
Dim Name As String
Dim ReceiverID2 As String
dtReceiver = New DataTable
dtReceiver.Columns.Add("ReceiverID", GetType(String))
dtReceiver.Columns.Add("Name", GetType(String))
dtDonor = New DataTable
dtDonor.Columns.Add("DonorID", GetType(String))
dtDonor.Columns.Add("Name", GetType(String))
Session("CurrentIndex") = 0
Session("dtDonor") = dtDonor
Session("dtReceiver") = dtReceiver
MsgBox(C1Country.SelectedItem.Value)
' This outer loop will iterate over the Link file where the ReceiverID node is equal to our search criteria
For Each xnLink As Xml.XmlNode In xdLink.SelectNodes("/Root/Link[ReceiverID='" & C1Country.SelectedItem.Value & "']")
Link_ID = xnLink.SelectSingleNode("Link_ID").InnerText
ReceiverID = xnLink.SelectSingleNode("ReceiverID").InnerText
DonorID = xnLink.SelectSingleNode("DonorID").InnerText
' Perform another similar search based upon the Donor XML file
For Each xnDonor As Xml.XmlNode In xdDonor.SelectNodes("/Root/Donor[DonorID='" & DonorID & "']")
DonorID2 = xnDonor.SelectSingleNode("DonorID").InnerText
Name = xnDonor.SelectSingleNode("Name").InnerText
dtDonor.Rows.Add({DonorID2, Name})
Next
dtLinkID = New DataTable
dtLinkID.Columns.Add("Link_ID", GetType(String))
' Perform yet another practically identical search on the Receiver XML file
For Each xnReceiver As Xml.XmlNode In xdReceiver.SelectNodes("/Root/Receiver[ReceiverID='" & ReceiverID & "']")
' Extract the ReceiverID and Name values from the current node
ReceiverID2 = xnReceiver.SelectSingleNode("ReceiverID").InnerText
Name = xnReceiver.SelectSingleNode("Name").InnerText
dtReceiver.Rows.Add({ReceiverID2, Name})
Next
' Extract the Link_ID avalues from the current node
LinkID2 = xnLink.SelectSingleNode("Link_ID").InnerText
dtLinkID.Rows.Add({LinkID2})
****************************************************************************************
Part B:
Code to Add new records in Link.xml file
Dim xyz() As String = New String() {"Donor", "Receiver", "Manufacturer"}
Dim searchIdFixDonor As String = Nothing
Dim searchIdFixReceiver As String = Nothing
Dim searchIdFixManufacturer As String = Nothing
Dim i As Integer
i = 0
For i = 0 To 2
Dim curXYZ = xyz(i)
Dim MyFix As XDocument = XDocument.Load(Server.MapPath("~/App_Data/" & curXYZ & ".xml"))
Dim xid As String
xid = curXYZ & "_ID"
Dim LargestFixID = (From el In MyFix.Descendants(curXYZ & "Table") Select CInt(el.<xid>.Value)).ToList
LargestFixID.Sort()
Dim xtable As String
xtable = curXYZ & "Table"
Dim xcontrol1 As C1ComboBox = DirectCast(MultiView1.FindControl("C1" & curXYZ), C1ComboBox)
Dim CheckForItemFix = (From el In MyFix.Descendants(xtable).Elements(curXYZ) Select el.Value).ToList
If Not CheckForItemFix.Contains(xcontrol1.Text) Then
Dim xNew As XElement = New XElement(xtable)
xNew.Add(New XElement(xid, (LargestFixID.Count() + 1)))
xNew.Add(New XElement(curXYZ, xcontrol1.Text))
MyFix.Root.Add(xNew)
MyFix.Save(Server.MapPath("~/App_Data/" & curXYZ & ".xml"))
If curXYZ = "Donor" Then
searchIdFixDonor = LargestFixID.Count() + 1
End If
If curXYZ = "Receiver" Then
searchIdFixReceiver = LargestFixID.Count() + 1
End If
If curXYZ = "Manufacturer" Then
searchIdFixManufacturer = LargestFixID.Count() + 1
End If
End If
Dim searchFix As String = xcontrol1.Text
Dim domFix As New XmlDocument()
domFix.Load(Server.MapPath("~/App_Data/" & curXYZ & ".xml"))
Dim listFix As XmlNodeList = domFix.SelectNodes("//" & xtable)
If CheckForItemFix.Contains(xcontrol1.Text) Then
For Each node As XmlNode In listFix
If node(curXYZ).InnerText.Equals(searchFix) Then
If curXYZ = "Donor" Then
searchIdFixDonor = node(xid).InnerText
End If
If curXYZ = "Receiver" Then
searchIdFixReceiver = node(xid).InnerText
End If
If curXYZ = "Manufacturer" Then
searchIdFixManufacturer = node(xid).InnerText
End If
Exit For
End If
Next
End If
'**************************************************************************************************************************
'Add data to Link File
Dim MyDocLink As XDocument = XDocument.Load(Server.MapPath("~/App_Data/LinkA.xml"))
Dim MyDocLinkSSADB As XDocument = XDocument.Load(Server.MapPath("~/App_Data/LinkSSADB.xml"))
Dim LinkID = (From el In MyDocLink.Descendants("LinkA") Select CInt(el.<LinkAID>.Value)).ToList
LinkID.Sort()
Dim xNewLink As XElement = New XElement("LinkA")
xNewLink.Add(New XElement("LinkAID", (LinkID.Last() + 1)))
If i = 2 Then
MyDocLink.Root.Add(New XElement("LinkA", New XElement("LinkAID", (LinkID.Last() + 1)), New XElement("Donor_ID", searchIdFixDonor), New XElement("Receiver_ID", searchIdFixReceiver), New XElement("Manufacturer_ID", searchIdFixManufacturer))
MsgBox("Data was Added")
End If
Next
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Help with amending Link.xml file
Nov 29, 2011 12:24 AM|LINK
Hello:)
You should first check whether there exists a node in your xml contents and then fetch it out, in the end change its Value and call Save for XDocument. Sample like this:
XDocument doc = XDocument.Load("xxx.xml");
var result = doc.Descedants("Your Tag Name Here").FirstOrDefault();
if(result!=null)
{
result.Value = "new value here";
doc.Save("Your path here");
}
vcharles
Member
76 Points
76 Posts
Re: Help with amending Link.xml file
Nov 30, 2011 09:25 AM|LINK
Hello,
I am trying the approach below but I'm running into a few difficulties, first withthe line below.
Dim nodeList As XmlNodeList = xmlDoc.SelectNodes("/LinkTable/LinkID[@ID='01']"
When I seach and find a record to amend, I retreive the ID value (LinkID2) with the code in my first post; How do I pass LinkID2 to the code:
Dim nodeList As XmlNodeList = xmlDoc.SelectNodes("/LinkTable/LinkID[@ID='01']")
Dim nodeList As XmlNodeList = xmlDoc.SelectNodes("/LinkTable/LinkID[@LinkID2]") ?
Example of Link.mll format:
<Root>
<LinkTable>
<LinkID>1</LinkID>
<ManufacturerID>1</ManufacturerID>
<ReceiverID> 3</ReceiverID>
<DonorID>4</DonorD>
</LinkTable>
<LinkTable>
PartA:
Code to retreive values is working OK:
Dim xyz() As String = New String() {"Donor", "Receiver", "Manufacturer"}
Dim searchIdFixDonor As String = Nothing
Dim searchIdFixReceiver As String = Nothing
Dim searchIdFixManufacturer As String = Nothing
Dim i As Integer
i = 0
For i = 0 To 2
Dim curXYZ = xyz(i)
Dim MyFix As XDocument = XDocument.Load(Server.MapPath("~/App_Data/" & curXYZ & ".xml"))
Dim xid As String
xid = curXYZ & "_ID"
Dim LargestFixID = (From el In MyFix.Descendants(curXYZ & "Table") Select CInt(el.<xid>.Value)).ToList
LargestFixID.Sort()
Dim xtable As String
xtable = curXYZ & "Table"
Dim xcontrol1 As C1ComboBox = DirectCast(MultiView1.FindControl("C1" & curXYZ), C1ComboBox)
Dim CheckForItemFix = (From el In MyFix.Descendants(xtable).Elements(curXYZ) Select el.Value).ToList
If Not CheckForItemFix.Contains(xcontrol1.Text) Then
Dim xNew As XElement = New XElement(xtable)
xNew.Add(New XElement(xid, (LargestFixID.Count() + 1)))
xNew.Add(New XElement(curXYZ, xcontrol1.Text))
MyFix.Root.Add(xNew)
MyFix.Save(Server.MapPath("~/App_Data/" & curXYZ & ".xml"))
If curXYZ = "Donor" Then
searchIdFixDonor = LargestFixID.Count() + 1
End If
If curXYZ = "Receiver" Then
searchIdFixReceiver = LargestFixID.Count() + 1
End If
If curXYZ = "Manufacturer" Then
searchIdFixManufacturer = LargestFixID.Count() + 1
End If
End If
Dim searchFix As String = xcontrol1.Text
Dim domFix As New XmlDocument()
domFix.Load(Server.MapPath("~/App_Data/" & curXYZ & ".xml"))
Dim listFix As XmlNodeList = domFix.SelectNodes("//" & xtable)
If CheckForItemFix.Contains(xcontrol1.Text) Then
For Each node As XmlNode In listFix
If node(curXYZ).InnerText.Equals(searchFix) Then
If curXYZ = "Donor" Then
searchIdFixDonor = node(xid).InnerText
End If
If curXYZ = "Receiver" Then
searchIdFixReceiver = node(xid).InnerText
End If
If curXYZ = "Manufacturer" Then
searchIdFixManufacturer = node(xid).InnerText
End If
Exit For
End If
Next
End If
Part B:
' Code to Amend Link file needs some modification to retreive proper LinkID data
Dim xmlDoc As New XmlDocument()
xmlDoc.Load(Server.MapPath("Link.xml"))
Dim nodeList As XmlNodeList = xmlDoc.SelectNodes("/Link/LinkID[LinkID2])?
' update Manufacturer
nodeList(0).ChildNodes(0).InnerText = searchIdFixManufacturer
' update Receiver
nodeList(0).ChildNodes(1).InnerText = searchIdFixReceiver
' update Donor
nodeList(0).ChildNodes(2).InnerText = searchIdFixDonor
' Don't forget to save the file
xmlDoc.Save(Server.MapPath("Link.xml"))
Msgbox("XML File update")
Secondly, when I find multiple records, How do I keep track of the correct LinkID2 value as I move to Next Previous records in order to update the correct records in my link.xml file? For example, As I move through each node of my individual xml files (Manufacturer, Receiver, Donor), how do I keep track of the correct LinkID2? Below is the code I'm using to move through the Donor records, is there a way to follow a similar approach to keep track of LinkID2?
Protected Sub Next_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Next.Click
dtDonor = Session("dtDonor")
currentIndex = Session("CurrentIndex")
If currentIndex > 0 Then
currentIndex -= 1
Session("CurrentIndex") = currentIndex
CmbDonor.Text = dtDonor.Rows(currentIndex).Item("Name")
End If
End Sub
Protected Sub Previous_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Previous.Click
dtDonor = Session("dtDonor")
currentIndex = Session("CurrentIndex")
If dtDonor.Rows.Count > 0 Then
currentIndex = 0
Session("CurrentIndex") = currentIndex
CmbDonor.Text = dtDonor.Rows(currentIndex).Item("Name")
End If
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Help with amending Link.xml file
Dec 03, 2011 01:39 AM|LINK
Dim nodeList As XmlNodeList = xmlDoc.SelectNodes("/LinkTable/LinkID[@LinkID2=]'"+Your Real LinkID2+"'")
Save it into Session。
vcharles
Member
76 Points
76 Posts
Re: Help with amending Link.xml file
Dec 04, 2011 01:29 PM|LINK
Hello,
I'm sorry but I don't understand the line below, based on the Link.xml file format on my initial post should the syntax be like the one I wrote below?
What do you mean by Your Real LinkID2? Do you mean my equation should be as follows?
Dim nodeList As XmlNodeList = xmlDoc.SelectNodes("/LinkTable/LinkID[@LinkID=LinkID2]")
As I move to the next record, How do I search for the latest LinkID2 to make sure I amend the right record?
Protected Sub Next_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Next.Click
' How do I keep track of latest linkID2?
dtDonor = Session("dtDonor")
currentIndex = Session("CurrentIndex")
If currentIndex > 0 Then
currentIndex -= 1
Session("CurrentIndex") = currentIndex
CmbDonor.Text = dtDonor.Rows(currentIndex).Item("Name")
End If
End Sub
Victor
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Help with amending Link.xml file
Dec 05, 2011 12:45 AM|LINK
Yes,I mean this what you've mentioned and I've referred above。
Your question isn't very clear——What do you mean by saying——latest LinkID2?You mean the biggest number of LinkID2 or soemthing?What condition you can tell what is the latest LinkID2?
Best reguards!