Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2012 DataGridView does not display the data from XML file

$
0
0
Hi there everyone.

As the titles says, I'm trying to load data into a datagridview from an xml file and the datagridview just doesn't show up any data at all. I've ran the debug to check if the variables and references were working right and it looks to me that the variables are working and recognizing the data on the xml file.

Here's my code:

Code:

Dim yourXmlFileWithFullPath As String = "PortalUNI429.xml"

        Dim newDataSet As DataSet = New DataSet("New DataSet")
        newDataSet.ReadXml(yourXmlFileWithFullPath)
        bsDeliverySites.DataSource = newDataSet
        dgDeliverySites.DataSource = bsDeliverySites
        dgDeliverySites.DataMember = "Order"

Note: bsDeliverySites is the name of the BindingSource component and dgDeliverySites is the name of the DataGridView component.

I can't post the XML file here, because it's part of the company I'm working at and it has a lot of sensitive information, but I can trully assure everyone that the xml file is 100% correctly coded, as it's being used for a few operations... although I can say that the node after root node is "Order" (this will explain the value of the DataMember field)

Does anyone know what am I missing here?

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>