Hello,
I have a procedure in VB.net using VS.net 2008 which will get the list of Orders and build a XML file with the list of Orders as shown in the code below:
As the number of Orders is getting huge, I want to build the XML file for every 500 Orders
Dim Orders as List(of Orders)=DAL.GetAllOrders()
Dim Order as new Orders
Public xmlstring As New StringBuilder
If Not Orders Is Nothing Then
xmlstring.Append("<?xml version=""1.0"" encoding=""Windows-1252"" standalone=""yes""?>")
xmlstring.Append("<Orders>")
For Each Order In Orders
'Build the XML File
next
'access web service and pass the XML file
end if
Instead of building XML for all the records I want to create XML for each 500 records. I tried the following code and it is throwing an error saying Expression is of type Orders which is not a collection type.
Please help
Dim start As Integer
For i As Integer = start To Orders.Count Step 500
xmlstring.Append("<?xml version=""1.0"" encoding=""Windows-1252"" standalone=""yes""?>")
xmlstring.Append("<Orders>")
For Each Order In Orders(i)
'Build the XML File
next
next