I am using Datatable to get some values from a database table.
DataTable dt = this.GetData();
StringBuilder html = new StringBuilder();
html.Append("<table border = '1'>");
foreach (DataRow row in dt.Rows)
{
html.Append("<tr>");
foreach (DataColumn column in dt.Columns)
{
html.Append("<td>");
html.Append(row[column.ColumnName]);
html.Append("</td>");
}
html.Append("</tr>");
}
html.Append("</table>");
The above code gives me this output:
The column with 0 0 is generated from the ID column of my table. I didn't pass the ID through my Stored Procedure because I dont need to display them. Is there a way to remove the first column itself and prevent it from displaying?