Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
XML
How to write Query to Display Column Names of HTML table in ListView

<HTML DIR=LTR>

<HEAD>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Windows-1252">

<TITLE>DailyReport</TITLE>

</HEAD>

<BODY>

<TABLE DIR=LTR BORDER>

<CAPTION>DailyReport</CAPTION>

<TR>

<TH>SLNo</TH>

<TH>Day</TH>

<TH>Date</TH>

<TH>Task</TH>

<TH>TaskPurpose</TH>

<TH>TimeTakeninMinutes</TH>

<TH>TaskDeliverable</TH>

<TH>Purpose</TH>

</TR>

</TABLE>

</BODY>

</HTML>

as of now i am displaying (Select * from HTML_Table) in Datagridview
but don't know how to get header name (<tr>)

We have to access header names
Posted

1 solution

You question is tagged incorrectly (This is an sql question)

Assuming you are using MS SQL of some sort.

You can try
SQL
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'xxx' ORDER BY ORDINAL_POSITION
 
Share this answer
 
Comments
amitk_189 15-Jul-11 3:37am    
Actually am doing a data-mining tool where databases contents has to be imported to software. I did 5 databases and XML, HTML is giving some problem
Reiss 15-Jul-11 4:02am    
can you treat your html pages as xhtml and use the same solution you use for xml files (I assume some sort of XPATH)
amitk_189 15-Jul-11 4:06am    
Will try, I will take input as html and internally do all modification and display as did for XML

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900