Dim xyz() As String = New String() {"Manufacturer", "Receiver"}
Dim i As Integer
i = 0
For i = 0 To 1
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 String
xcontrol1 = "Me.C1" & curXYZ & ".Text"
Dim xcontrol As String
xcontrol = "Me.C1" & curXYZ & ".Text.ToString"
Dim CheckForItemFix = (From el In MyFix.Descendants(xtable).Elements(curXYZ) Select el.Value).ToList
If Not CheckForItemFix.Contains(xcontrol1) Then
Dim xNew As XElement = New XElement(xtable)
xNew.Add(New XElement(xid, (LargestFixID.Last() + 1)))
xNew.Add(New XElement(curXYZ, xcontrol1))
MyFix.Root.Add(xNew)
MyFix.Save(Server.MapPath("~/App_Data/" & curXYZ & ".xml"))
End If
Dim searchFix As String = xcontrol1
Dim searchIdFix As String = Nothing
Dim domFix As New XmlDocument()
domFix.Load(Server.MapPath("~/App_Data/" & curXYZ & ".xml"))
Dim listFix As XmlNodeList = domFix.SelectNodes("//" & xtable)
If CheckForItemFix.Contains(xcontrol1) Then
For Each node As XmlNode In listFix
If node(curXYZ).InnerText.Equals(searchFix) Then
searchIdFix = node(xid).InnerText
Exit For
End If
Next
End If
Next
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE