3 Replies - 1271 Views - Last Post: 15 September 2011 - 01:47 PM Rate Topic: -----

#1 Gorax   User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 11
  • Joined: 24-August 11

How do I Iterate through the nodes into a dataTable ?

Posted 15 September 2011 - 01:25 PM

<html>
     <head>
	<title>HDFS Reporting</title>
     </head>
	<body>
	     <table width= 100% border= 1 cellpadding=1 cellspacing=0 ID=Table1></tr>
		   <tr>
			<th nowrap><b><a Javascript:doOrder('statusId')">Status</a></b></th>
			<th nowrap><b><a Javascript:doOrder('ProjID')">Proj</a></b></th>		
			<th nowrap><b><a href="Javascript:doOrder('ProjectName')">Proj </a></b></th>
			<th nowrap><b><a Javascript:doOrder('TaskAlpha')">Task</a></b></th>						
			<th nowrap><b><a href="Javascript:doOrder('TaskName')">Task </a></b></th>
		   </tr>
		   <tr>
			<td nowrap align="Center"><font color ="BLACK">O&nbsp;
			<td>P0P0V</td>
			<td>CR TMI Remediation&nbsp;</td>
			<td>T615T</td>
			<td>TMI Configuration Remediation Issues-08/08/2011&nbsp;</td>
		   </tr>
		   <tr>
			<td nowrap align="Center"><font color ="BLACK">D&nbsp;
			<td>P0NK0</td>
			<td>CR TMI Remediation&nbsp;</td>
			<td>T615T</td>
			<td>TMI Configuration Remediation Issues-08/08/2011&nbsp;</td>
		    </tr>
 	       </table>
	</body>
</html>


         private void TryingToIterateThroughNodes()
         {
                /*Declare MyDoc as doc*/
                 HtmlAgilityPack.HtmlDocument MyDoc = new HtmlAgilityPack.HtmlDocument();
	
                /*Load the HTML File*/
                 MyDoc.Load(@"d:\test\test\detail.html");

               /*Declare Rows as htmlcollection*/
                HtmlAgilityPack.HtmlNodeCollection Rows = MyDoc.DocumentNode.ChildNodes;

                for (int Numero = 0; Numero < Rows.Count; Numero++)
                {
                      var t1 = Rows[Numero].InnerText.ToString();
                 }
           } 



Is This A Good Question/Topic? 0
  • +

Replies To: How do I Iterate through the nodes into a dataTable ?

#2 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: How do I Iterate through the nodes into a dataTable ?

Posted 15 September 2011 - 01:26 PM

What's wrong with your code? Please post specific problems and errors.
Was This Post Helpful? 0
  • +
  • -

#3 Gorax   User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 11
  • Joined: 24-August 11

Re: How do I Iterate through the nodes into a dataTable ?

Posted 15 September 2011 - 01:35 PM

View Postmacosxnerd101, on 15 September 2011 - 01:26 PM, said:

What's wrong with your code? Please post specific problems and errors.


The problem is I can see the data through the Console.WriteLine, but I dont know
how to store it into a datatable ..
Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6538
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: How do I Iterate through the nodes into a dataTable ?

Posted 15 September 2011 - 01:47 PM

MSDN page with examples on Datatable

Have you gone through this page and its code?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1