XML reading in VB.NET

Asked

Viewed 45 times

2

Good morning gentlemen, I’m having a hard time reading some XML fields. For example, I am developing a sales software and at the time of reading the XML for printing it is pulling only one item instead of all. The XML itself has 3 items but when I have the printer printed, only 1. Below is the structure of my code in VB.NET, who can help me I will be immensely grateful.

/Lendo o Xml
Dim produto As New BindingSource
        produto.DataSource = ds
        produto.DataMember = "det"
        produto.DataMember = "prod"
        Dim descricao As String = produto.Current("xProd").ToString()
        Dim quantidade As String = produto.Current("qCom").ToString()
        Dim valorprod As String = produto.Current("vProd").ToString()

/Imprimindo o XML
escreve.Write("#  Descricao           Qtde X Preco      Total" & vbNewLine)
        escreve.Write("------------------------------------------------" + vbNewLine)
        escreve.Write("" + descricao + "    " + quantidade + " X " + valorprod + "    " + valorprod & vbNewLine & vbNewLine)
  • 1

    Can you see the XML structure? An example?

  • <det nItem="1">&#xA;<prod>&#xA;<cProd>7898577370182</cProd>&#xA;<xProd>J.WATANABE/COUVE MANTE</xProd> &#xA;</prod> &#xA;<det nItem="2">&#xA;<prod>&#xA;<cProd>66396</cProd>&#xA;<xProd>BULK/GARLIC KG</xProd> </Prod> </det>

  • 1

    Matheus, there are several examples of XML with VB.Net in Vbmania... have you tried running any? Please punctuate me on the other topic I helped you with the Epson TM T20 printer?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.