Do XML Attributes HURT VB.Net DATAVIEWS????

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alan Mailer

    Do XML Attributes HURT VB.Net DATAVIEWS????

    I don't know how else to put this, because I'm new to VB.net but here
    goes...

    I'm trying to create a DataView from an XML file. Some of the nodes
    in the XML file happen to have Attributes, others do not. Lets use
    the following as an example:

    <MyXml>
    <ANode>
    <ANodeWithNoAtt ribute>Hello</ANodeWithNoAttr ibute>
    <ANodeWhichHasA nAttribute MyAttribute="My AttributeValue" >World.
    </ANodeWhichHasAn Attribute>
    </ANode>
    </MyXml>

    Now, imagine I'm creating a DataSet based on the above XML document
    called "MyDataSet" . I then create a DataView based on "MyDataSet" in
    the following manner:

    MyDataView = New DataView(MyData Set.Tables("ANo de"))

    Am I going crazy, or are both of the two following propositions true:

    Proposition 1) A DataView will not 'Sort' by a Node that has an
    Attribute in it. In fact, attempting to do so will trigger an Error.

    (If I'm correct about Proposition 1, using the above XML, the line
    MyDataView.Sort ("ANodeWhichHas AnAttribute ")... would trigger an
    error.

    Proposition 2) If you make a DataView the DataSource of a
    DataGridView, the only columns which will appear in the DataGridView
    are the ones associated in the underlying XML with Nodes that *do not*
    have Attributes linked to them.

    (If I'm correct about Proposition 2, using the above XML, a
    DataGridView which had MyDataView as a DataSource would only end up
    displaying ONE column; a column called "ANodeWithNoAtt ribute" with the
    value "Hello" in it.

    ....Can someone please tell me if I'm right about these DataView
    'propositions'? Of course, if I'm wrong, and I hope I am, PLEASE help
    me out of this problem.

    Thanks in advance.
Working...