Vb.net read/write xml (2) -- implement communication between datagrid and xml

Source: Internet
Author: User


Note: I mainly refer to the previous article "VB and VB. NET XML operations" Article url: http://www.wrclub.net/study/listarticle.aspx? Id = 1459
This section describes the general process. However, in my actual application process
In the article code:
Dim mySDD As System. Xml. XmlDataDocument
MyXDD = New System. Xml. XmlDataDocument (Me. dsMaster1)
MyXDD. Load ("dataOnly. xml ")
SetBindings (Me. dsMaster1)
The SetBindings method never knows what it is and cannot be found in msdn, so it is still not implemented according to the method in his article. I have referred to msdn, but this article is still very helpful to me, although it also led to some detours.
Here we mainly post two events to load xml into the datagrid:
'If ds is used directly as the datasource, The datagrid is not expanded. If dv is used, the result is displayed correctly.
Dim ds As DataSet = New DataSet
Ds. ReadXml (xmlFile)
Dim tb As DataTable
Dim dv As DataView
Tb = ds. Tables (0)
Dv = New DataView (tb)
'Maid. DataSource = dv
'Maid. DataMember = "testXmlMember"
'Maid. DataMember = "employeefname"
'Dim dxd As New XmlDataDocument
DataGrid1.SetDataBinding (dv ,"")

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.