If dt.Rows.Count <> 0 Then
'Save File Xml to D:\NewFolder
dt.WriteXml("D:\NewFolder\Test.xml", XmlWriteMode.WriteSchema, True)
End If
End Sub
Function ReadXml_dt()
Dim _filePath As String = "D:\NewFolder"
Dim _fileName As String = "Test.xml"
Dim dt As New DataTable("dt")
Dim ds As New DataSet()
If System.IO.Directory.Exists(_filePath) Then ' if not directory name
Dim di As New DirectoryInfo(_filePath)
Dim aryFi As FileInfo() = di.GetFiles(_fileName)
Dim fi As FileInfo
'Read File Xml
For Each fi In aryFi
ds.ReadXml(_filePath & "\" & _fileName)
dt = ds.Tables(0).Copy
Next
End If
Return dt
End Function