I am declaring a SQL string that looks something similar to the following:
string SQL = "SELECT Column1, Column2, Column3, Date1, Date2 FROM Somewhere";
The number of columns can vary by circumstance and the dates can be called different names such as StartDate, InterestDate and so on.
What I would like to do is bind this to an ASP.NET Repeater and create a table as below for the example above:
<table>
<tr>
<th>Column1</th>
<th>Column2</th>
<th>Column3</th>
<th>Date1</th>
<th>Date2</th>
</tr>
<tr>
Rows of values...
</tr>
</table>
I am fine with binding the data to a Repeater and using Eval but that is dependant on a fixed number of columns and column names. Can this be done in a programmatic way?