You can get the data in a dataset and then use a div and assign runat = server property to it. Then you can use string builder to create the HTML table as shown below.
StringBuilder strResults = new StringBuilder();
strResults.Append("<table>");
for (int i = 0; i <= ds.tables(0).rows.Count; i++) {
strResults.Append("<tr>");
strResults.Append("<td>");
strResults.Append(ds.tables(0).rows(i)("ColumnName"));
strResults.Append("</td>");
strResults.Append("<tr>");
}
strResults.Append("</table>");
divResults.innerHTML = strResults.ToString();
found it
here[
^]