snippet: view plain - save this
1 Function ReadXMLFile()
2 Dim strBuilder As StringBuilder = New StringBuilder() 'Read XML File
3 Dim ds As New DataSet()
4 ds.ReadXml("C:\Website\XMLMadness\App_Data\USA.xml") 'Iterate through the tables in DataSet.
5 Dim dt As DataTable
6 dt = ds.Tables(0) 'Iterate through the rows in a table.
7 Dim n As Integer
8 For n = 0 To dt.Rows.Count - 1 'Do stuf to your data here.
9 'strBuilder.Append(dt.Rows(n)(1) & vbCrLf)
10 strBuilder.Append(dt.Rows(n)(1) & "<br />")
11 'strBuilder.Append(Chr(34) & dt.Rows(n)(0) & Chr(34) & "<br />")
12 'Get a different column
13 'strBuilder.Append(Chr(34) & dt.Rows(n)(1) & Chr(34) & "<br />")
14 Next
15 Literal1.Text = strBuilder.ToString
16 Return strBuilder.ToString()
17 End Function

0 comments