• After more than 30 years running websites and forums I am retiring.

    I have made many friends through the years. I will cherish my time getting to know you. I wish you all the best. This was not an easy decision to make. The cost to keep the communities running has gotten to the point where it's just too expensive. Security certificates, hosting cost, software renewals and everything else has increased threefold. While costs are up ad revenue is down. It's no longer viable to keep things running.

    All sites will be turned off on Thursday 30 November 2023. If you are interested in acquiring any of the websites I own you can Email Schwarz Network.

Coördinates after XML to dataset


Apr 1, 2008
In my sample XML the object is "ZB". That "ZB" has two points, "AAD" and "AAG". Both points have coördinates, devided by the "|" character. This is a fixed format, I have to deal with it.

Because in our software, we use the data in a dataset. So we convert the XML tot a dataset with the command:
Dim myDS As DataSet
Dim fsReadXml As New System.IO.FileStream(myXMLFile, System.IO.FileMode.Open)

After that, I have 4 tables in my dataset:
  • ZB
  • AAE
  • AAG
  • point

Automaticly there are relations and hidden id's added. After that, I connect 2 datagrids with this code. One datagrid with all objects and the second grid shows me the coördinates of the selected object in datagrid 1:
            Dim myBS As New BindingSource
            myBS.DataSource = myDS

            DataGridView1.DataSource = myBS
            DataGridView1.DataMember = "ZB"

            DataGridView2.DataSource = myBS
            DataGridView2.DataMember = "ZB.ZB_AAE.AAE_point"

So far so good, everything works fine!

I can databind labels or other textboxes to the point, after clicking a "ZB" object. Its with this code:
            TextBox1.DataBindings.Add(New Binding("text", myBS, "ZB.ZB_AAG.AAG_point.pos"))

What do I want?
I want the objects and coördinates in one datagrid. So I want to create a view, adding a custom column, and see the results back in a datagrid.

I tried the following. All commented lines I tried. I can't find the proper way to build a expression so the coördinates were shown:
Dim Test As DataColumn = myDS.Tables("ZB").Columns.Add("test", GetType(String))
Test.Expression = "ZB.ZB_AAE.AAE_point"
        'Test.Expression = "Child(ZB.ZB_AAE).point"
        'Test.Expression = "Child(ZB_AAE).point"
        'Test.Expression = "Child(point)"
        'Test.Expression = "Child(pos)"
        'Test.Expression = "ZB_AAE.point"
        'Test.Expression = "ZB.ZB_AAE.point.pos"
        'Test.Expression = "point"
        'Test.Expression = "point.pos"
        'Test.Expression = "Parent.ZB_AAE.AAE_point.pos"
        'Test.Expression = "Parent(ZB_AAE).AAE_point"
        'Test.Expression = "Parent.ZB"
        'Test.Expression = "ZB_AAE.AAE_point.pos"
        'Test.Expression = "Child.ZB_AAE.point.pos"

You can use this XML to test:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<!-- File Header -->
<DATA xmlns:nl= "http://www.w3.org/2001/XMLSchema-instance" 
<gml:point srsName="Netherlands-RD" srsDimension="2">
<gml:point srsName="Netherlands-RD" srsDimension="2">
<gml:point srsName="Netherlands-RD" srsDimension="2">
<gml:point srsName="Netherlands-RD" srsDimension="2">
Last edited:
Top Bottom