Thursday, 8 May 2014

Bind Table through Dataset

public DataSet ds;

protected void Page_Load(object sender, EventArgs e)
{
    ds = new DataSet();
    //load your ds from database
}
Following is the code to use table 0 from database to create table in aspx
<table>
<% foreach(DataRow row in ds.Tables[0].Rows) { %>
<tr>
<td><%= row["columnName"] %></td>
</tr>
<% } %>
</table>

No comments:

Post a Comment