MR alaa

MR alaa

  • NA
  • 631
  • 21.4k

show all data in html table

Mar 30 2016 12:46 PM
hi every body
i have a page that i need to show searched data in it my database is excel suppose i don't know how many columns and rows i need to show all data in a table depend on number of columns if there is one column in excel sheet it drew a table with on columns um if they are column i excel sheet it draw 10 columns in page and so on the header of the table should be the same in excel
how can it be done in asp.net c# ?
 
use something like that but i need to know how to appened data to html
foreach (DataColumn column in ds.Tables[0].Columns)
{

lblresult.Text = column.ColumnName;
}

to be like that
html.Append("<td>" + ds.Tables[0].Rows[i]["ID"] + "</td>");

this gets me header what about data in rows

foreach (DataRow row in ds.Tables[0].Rows)
{

lblresult.Text = ??? to get values;
}
 

Answers (3)