Load XML file into a Datatable



I am trying to load an xml file into a datable but I don't know where to start. The Xml file has tags to help identify the Headers, the rows, and the columns. Below is a sample:



<result>
<info>
<title>Summary By Employee: My Default</title>
<sorted-by>Employee Name Ascending</sorted-by>
<filtered-by>Employee: All; Dates: 01/11/2015-01/17/2015</filtered-by>
<date>01/21/2015</date>
<time>08:40a</time>
<generated-by>Joe Doe </generated-by>
</info>
<header>
<col>
<label>Employee Id</label>
</col>
<col>
<label>Employee Name</label>
</col>
<col>
<label>Regular</label>
</col>
<col>
<label>Overtime</label>
</col>
<col>
<label>Premium</label>
</col>
<col>
</header>
<body>
<row>
<col>022692</col>
<col>James, Mitchel</col>
<col>-</col>
<col>-</col>
<col>-</col>
</row>
<row>
<col>022685</col>
<col>Doe, Joe</col>
<col>-</col>
<col>-</col>
<col>-</col>
</row>


Any ideas on how to accomplish this ?


Thanks for the help.


No comments:

Post a Comment