Dim myStream As System.IO.Stream
Dim openFileDialog1 As New OpenFileDialog()
openFileDialog1.Title = "Open an XML file to analyze"
openFileDialog1.InitialDirectory = "c:\"
openFileDialog1.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*"
openFileDialog1.FilterIndex = 1
openFileDialog1.RestoreDirectory = True
If openFileDialog1.ShowDialog() = DialogResult.OK Then
myStream = openFileDialog1.OpenFile()
ProfileName = openFileDialog1.FileName
MsgBox(ProfileName)
Dim newDataSet As New DataSet()
newDataSet.ReadXml(ProfileName)
DataGrid1.SetDataBinding(newDataSet, "point")
If Not (myStream Is Nothing) Then
myStream.Close()
End If
End If