Creating tables and displaying textboxes in codebehind
<p>I have a Dataset from the database which i want to display. My aim is to display a month's data on an aspx page using VS 2005 with 5 days per each row. I have written the code like this but i am confused with the i and j. This code displays nothing. </p>

<pre><code>if (ds != null &amp;&amp; ds.Tables[0].Rows.Count &gt; 0)
{
    Table table = new Table();
    table.ID = "Table1";

    TableRow row = new TableRow();
    TableCell cell = new TableCell();
    TextBox tb1 = new TextBox();
    TextBox tb2 = new TextBox();

    // I am not sure what i and j should be here to display 5 per each row..
    for (int i = 0; i &lt; 5; i++)
    {
        if (int j == 0; j &lt; ds.Tables[0].Rows.Count; j ++)
        {

             tb1.ID = "txtDateRow" + x + "Col" + j;
             tb1.Text = ds.Tables[0].Rows[x]["Date"].ToString();
             tb2.ID = "txtDetails" + x + "Col" + j;
             tb2.Text = ds.Tables[0].Rows[x]["AmountSold"].ToString();
             cell.Controls.Add(tb1);
             cell.Controls.Add(tb2);
             table.Rows.Add(row);
        }
    }
    Panel1.Controls.Add(table);
}
</code></pre>

<p>If someone could help me solve this, i really appreciate it. Thanks a lot. </p>
