|
Public Class Form1
Private mXmlFilePath As String = "c:\Temp\XmlDatabaseDemo.xml"
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
'If the file exists, then read the data from the Xml file
' into the DataSet
If My.Computer.FileSystem.FileExists(mXmlFilePath) = True Then _
DsXmlDbDemo.ReadXml(mXmlFilePath)
End Sub
Private Sub CustomersBindingNavigatorSaveItem_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles CustomersBindingNavigatorSaveItem.Click
'Commit the Customer Data and the Orders Data to each
' respective DataTable.
Me.Validate()
CustomersBindingSource.EndEdit()
OrdersBindingSource.EndEdit()
'Write the data from the DataSet out to the Xml File.
DsXmlDbDemo.WriteXml(mXmlFilePath)
End Sub
Private Sub OrdersDataGridView_Enter(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles OrdersDataGridView.Enter
'Commit the Customer Data to the DataTable
CustomersBindingSource.EndEdit()
End Sub
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.