There are multiple methods to go about this. The method i prefer is
using Xml output from a database and XSLT. Sadly microsoft refuses to fully
support this technology and advance it to its full potential however even
being bastardized and stepped aside it can be extremely useful once you have
created your own user functions and gotten familiar with using XSL to
transform data into output.
The second way can be to just to try to optimized code as much as possible
HtmlTableCell[] TmpCElls = new HtmlTableCell[8];
for (int32 i=0; i<8; i++) { TmpCells[i] = new HtmlTableCell(); }
while (TmpReader.Read())
{
for (int32 i=0; i<8; i++) { tmpCells[i].Text = TmpReader..... }
}
is one example of how you can make reduce the amount of code required.
I still prefer XML/XSLT for most things related to displaying data.
There are also data grids which are sometimes useful for displaying data
quickly as long as you don't need to make any customizations and don't care
about the output.
<tv********@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Hi,
I have a user control which dynamically creates a table with one row
and 8 columns. I have got values to display on all the 8 columns. But
when I construct the table, I need to create 8 table cells though, is
there any other way I can dynamically generate without having to do the
new HtmlTableCell() for 8 times for 8 cells ?.
And what is the best approach to create table and display values in
seperate columns, in this situation ?. Thanks.
Karthick