Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

save xml changes from data grid view

$
0
0

how can I save chenges of xml file loaded in data grid view , I wrote a code that load the xml file into the datagrid view , I might sometimes changes the values in the data grid view , how can I write and save the changes in the xml file ?

 

code to load the xml file :

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


        OpenFileDialog1.ShowDialog()
        OpenFileDialog1.Filter = "xml (*.xml)|*.xml"
        Dim locate As String = OpenFileDialog1.FileName


        Dim xmlFile As XmlReader
        xmlFile = XmlReader.Create(locate, New XmlReaderSettings())
        Dim ds As New DataSet
        ds.ReadXml(xmlFile)
        DataGridView1.DataSource = ds.Tables(0)
    End Sub

 


Viewing all articles
Browse latest Browse all 2535

Trending Articles



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