Example 1:)
Write:
dt1.TableName = "MyDataTable"
dt1.WriteXmlSchema(Application.StartupPath + "\test_sh.xml", True)
dt1.WriteXml(Application.StartupPath + "\test_dt.xml", True)
Read:
dt2 = New DataTable
dt2.ReadXmlSchema(Application.StartupPath + "\test_sh.xml")
dt2.ReadXml(Application.StartupPath + "\test_dt.xml")
Example 2:)
Write:
Dim writer As System.IO.StringWriter = New System.IO.StringWriter()
customerTable.WriteXml(writer, XmlWriteMode.WriteSchema, False)
Write:
writer = New System.IO.StringWriter()
customerTable.WriteXml(writer, XmlWriteMode.WriteSchema, True)
Example 3:)
Write:
Dim xmlStream As System.IO.MemoryStream = New System.IO.MemoryStream()
table.WriteXml(xmlStream, XmlWriteMode.WriteSchema)
xmlStream.Position = 0
Read:
Dim newTable As DataTable = New DataTable()
newTable.ReadXml(xmlStream)
Example 4:)
Write:
Dim fileName As String = "C:\TestData.xml"
table.WriteXml(fileName, XmlWriteMode.WriteSchema)
Read:
Dim newTable As DataTable = New DataTable()
newTable.ReadXml(fileName)
'자료' 카테고리의 다른 글
구글 애드센스 상단에 2개 적용하는 방법 (0) | 2020.09.25 |
---|---|
[C# / vb.net] HtmlAgilityPack 라이브러리를 이용한 크롤링시 라이브러리 예제 (0) | 2020.09.24 |
[C#/vb.net] DateTimePicker 표시형식 변경 (0) | 2020.09.24 |
[C#/vb.net] 네이버 맞춤법 검사 (WinHttp이용) (0) | 2020.09.24 |
마이크로소프트 오피스 2019 정품인증 쉽게 하기 (ms office 무료로 다운로드와 설치가능한 크랙 포함) (0) | 2020.09.17 |