For i = Me.C1TrueDBGrid4.SelectedRows.Count - 1 To 0 Step -1
Dim DVa As New DataView(dtb, "Child_Item_ID like " & "'" & C1TrueDBGrid4.Columns(0).Value & "'" & " or Parent_Item_ID like " & "'" & C1TrueDBGrid4.Columns(0).Value & "'" & "", Nothing, DataViewRowState.CurrentRows)
For X = DVa.Count - 1 To 0 Step -1
DVa.Item(X).Delete()
Next
Dim DV1 As New DataView(dtb, "", Nothing, DataViewRowState.CurrentRows)
Dim FilteredDT As DataTable
FilteredDT = DV1.ToTable
FilteredDT.TableName = "Row"
FilteredDT.WriteXml(Application.StartupPath + "\Data\LinkFiles\LinkItemUSA.xml")
Dim DVa1 As New DataView(dtc, "Item_ID like " & "'" & C1TrueDBGrid4.Columns(0).Value & "'" & "", Nothing, DataViewRowState.CurrentRows)
For X = DVa1.Count - 1 To 0 Step -1
DVa1.Item(X).Delete()
Next
Dim DV11 As New DataView(dtc, "", Nothing, DataViewRowState.CurrentRows)
Dim FilteredDT1 As DataTable
FilteredDT1 = DV11.ToTable
FilteredDT1.TableName = "Row"
FilteredDT1.WriteXml(Application.StartupPath + "\Data\LinkFiles\LinkPPFUSA.xml")
ASKER
ASKER
ASKER
Dim s As String = "'BEL', 'FRA', NLD, USA"
Dim charSeparators() As Char = {","c}
Dim CountrySet As String() = s.Split(charSeparators)
For j As Integer = 0 To CountrySet.GetUpperBound(0)
' Remove quotes if around code
If Mid(CountrySet(j), 1, 1) = "'" Then
CountrySet(j) = Mid(CountrySet(j), 2, Len(CountrySet(j)) - 2)
End If
For i = Me.C1TrueDBGrid4.SelectedRows.Count - 1 To 0 Step -1
Dim DVa As New DataView(dtb, "Child_Item_ID like " & "'" & C1TrueDBGrid4.Columns(0).Value & "'" & " or Parent_Item_ID like " & "'" & C1TrueDBGrid4.Columns(0).Value & "'" & "", Nothing, DataViewRowState.CurrentRows)
For X = DVa.Count - 1 To 0 Step -1
DVa.Item(X).Delete()
Next
Dim DV1 As New DataView(dtb, "", Nothing, DataViewRowState.CurrentRows)
Dim FilteredDT As DataTable
FilteredDT = DV1.ToTable
FilteredDT.TableName = "Row"
FilteredDT.WriteXml(Application.StartupPath + "\Data\LinkFiles\LinkItem" & CountrySet(j) & ".xml")
Dim DVa1 As New DataView(dtc, "Item_ID like " & "'" & C1TrueDBGrid4.Columns(0).Value & "'" & "", Nothing, DataViewRowState.CurrentRows)
For X = DVa1.Count - 1 To 0 Step -1
DVa1.Item(X).Delete()
Next
Dim DV11 As New DataView(dtc, "", Nothing, DataViewRowState.CurrentRows)
Dim FilteredDT1 As DataTable
FilteredDT1 = DV11.ToTable
FilteredDT1.TableName = "Row"
FilteredDT1.WriteXml(Application.StartupPath + "\Data\LinkFiles\LinkPPF" & CountrySet(j) & ".xml")
Next i
Next j
This goes through the same set of selected rows from the C1TrueDBGrid4 table for each country. You may need to change the selection of rows for each country, or something that. The place to change the row selection would be right before the Next j at the end of the routine.
ASKER
ASKER
ASKER
The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.
TRUSTED BY
Open in new window