Error trying to get the value in a section of XML in VB.NET

1

The error happens as soon as it passes the first "dEmi" element.

XML:

<ide>
  <cUF>11</cUF>
  <cNF>855305</cNF>
  <mod>59</mod>
  <nserieSAT>900000980</nserieSAT>
  <nCFe>000225</nCFe>
  <dEmi>20150109</dEmi>
  <hEmi>132824</hEmi>
  <cDV>1</cDV>
  <tpAmb>2</tpAmb>
  <CNPJ>12345678901234</CNPJ>
  <signAC>SGR-SAT SISTEMA DE GESTAO E RETAGUARDA DO SAT</signAC>
  <assinaturaQRCODE>12312</assinaturaQRCODE>
  <numeroCaixa>010</numeroCaixa>
</ide>

Code:

  Dim document = XDocument.Load("C:\MinhaXML.xml") 

        For Each rXML In document.Descendants("ide")
            sData = rXML.Elements("dEmi").value.ToString
            sHora = rXML.Elements("hEmi").Value
            sQRCODE = rXML.Elements("assinaturaQRCODE").Value
        Next

ERROR:

public member 'value' on type '<GetElements>d__11' not  found
    
asked by anonymous 09.01.2015 / 18:42

1 answer

0

 Dim document as XDocument = XDocument.Load("C:\MinhaXML.xml") 

So my Documentary Variable was assigned with the Class .value

    
09.01.2015 / 19:18