"COMO CARREGAR DADOS DO XML PARA VBNET" Code Answer's

You're definitely familiar with the best coding language VBA that developers use to develop their projects and they get all their queries like "COMO CARREGAR DADOS DO XML PARA VBNET" answered properly. Developers are finding an appropriate answer about COMO CARREGAR DADOS DO XML PARA VBNET related to the VBA coding language. By visiting this online portal developers get answers concerning VBA codes question like COMO CARREGAR DADOS DO XML PARA VBNET. Enter your desired code related query in the search bar and get every piece of information about VBA code related question on COMO CARREGAR DADOS DO XML PARA VBNET. 

COMO CARREGAR DADOS DO XML PARA VBNET

By MFMF on Nov 30, 2020
 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'Cria uma instância de um documento XML
        Dim oXML As New XmlDocument
        Dim oNoLista As XmlNodeList
        Dim oNo As XmlNode

        'Define o caminho do arquivo XML 
        Dim ArquivoXML As String = txtNomeArquivo.Text
        'carrega o arquivo XML
        oXML.Load(ArquivoXML)

        'Lê o filho de um Nó Pai específico 
        Dim nomeAluno As String = oXML.SelectSingleNode("Alunos").ChildNodes(0).InnerText
        Dim idadeAluno As String = oXML.SelectSingleNode("Alunos").ChildNodes(1).InnerText
        Dim emailAluno As String = oXML.SelectSingleNode("Alunos").ChildNodes(2).InnerText

        '*** Exibe Dados do aluno
        lstDados.Items.Add(nomeAluno)
        lstDados.Items.Add(idadeAluno)
        lstDados.Items.Add(emailAluno)

         ' Define o nó para nova leitura
        oNoLista = oXML.SelectNodes("/Alunos/Endereco")

        'percorre os nós filhos do Nó especificaod e obtem o atributo e os valores
        For Each oNo In oNoLista
            lstDados.Items.Add(oNo.Attributes.GetNamedItem("tipo").Value)
            lstDados.Items.Add(oNo.ChildNodes.Item(0).InnerText)
            lstDados.Items.Add(oNo.ChildNodes.Item(1).InnerText)
            lstDados.Items.Add(oNo.ChildNodes.Item(2).InnerText)
            lstDados.Items.Add(oNo.ChildNodes.Item(3).InnerText)
            lstDados.Items.Add(oNo.ChildNodes.Item(4).InnerText)
        Next

    End Sub

Source: www.macoratti.net

Add Comment

0

All those coders who are working on the VBA based application and are stuck on COMO CARREGAR DADOS DO XML PARA VBNET can get a collection of related answers to their query. Programmers need to enter their query on COMO CARREGAR DADOS DO XML PARA VBNET related to VBA code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about COMO CARREGAR DADOS DO XML PARA VBNET for the programmers working on VBA code while coding their module. Coders are also allowed to rectify already present answers of COMO CARREGAR DADOS DO XML PARA VBNET while working on the VBA language code. Developers can add up suggestions if they deem fit any other answer relating to "COMO CARREGAR DADOS DO XML PARA VBNET". Visit this developer's friendly online web community, CodeProZone, and get your queries like COMO CARREGAR DADOS DO XML PARA VBNET resolved professionally and stay updated to the latest VBA updates. 

VBA answers related to "COMO CARREGAR DADOS DO XML PARA VBNET"

View All VBA queries

VBA queries related to "COMO CARREGAR DADOS DO XML PARA VBNET"

Browse Other Code Languages

CodeProZone