ASP.NET C# Add items to list from stored proc dynamically
<p>I would like to have my accounts shown like below (In a List) </p>

<pre><code>&lt;div id=AccountDiv" class"account-table"&gt;

&lt;div class="color-1"&gt;
&lt;h3&gt;Account Information&lt;/h3&gt;
&lt;ul&gt;
    &lt;li style="text-align: left" &gt;Electric: Austin Energy - 10265&lt;/li&gt;
    &lt;li style="text-align: left"&gt;Gas: Texas Gas Service - 15754892 &lt;/li&gt;
    &lt;li style="text-align: left"&gt;Propane: Propane Austin - 577-12&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

&lt;div&gt;
</code></pre>

<p>I would like to pull each account information from a database dynamically. I'm new to asp.net so I wrote the below</p>

<pre><code>&lt;div id=AccountDiv" class"account-table"&gt;
&lt;asp:Panel ID="AccountDiv" runat="server" CssClass="account-table"&gt;
&lt;div class="color-1"&gt;
&lt;h3&gt;Account Information&lt;/h3&gt;
&lt;ul&gt;

&lt;/ul&gt;
&lt;/div&gt;
&lt;asp:Panel&gt;
&lt;div&gt;
</code></pre>

<p>This is what I wrote back-end.</p>

<pre><code>void PopulateAccountInformation()
    {

        DataAccess da = new DataAccess();
        da.AddParameter("SiteID", SiteID, DataAccess.SQLDataType.SQLInteger, 4);
        SiteHeader = da.runSPDataSet("GetSiteAccountList");

       for (int i = 0; i &lt; SiteHeader.Tables[0].Rows.Count; i++)
        {
            Label LabelAccount = new Label();

            LabelAccount.Text = "Account Number: " + SiteHeader.Tables[0].Rows[i]["Account Number"].ToString();
            AccountDiv.Controls.Add(LabelAccount);
            AccountDiv.Controls.Add(new LiteralControl("&lt;br /&gt;"));

        }


    }
</code></pre>

<p>It displays the information like:</p>

<p>Account Number: 3 786 843-7</p>

<p>Account Number: 6 520 325-9</p>

<p>Account Number: 80-000178814-0162499-3</p>

<p>Account Number: 100269408-Swr</p>

<p>Account Number: 100034269</p>

<p>Account Number: 100269408</p>

<p>Which is nice, but How to I write it so it makes a list for each Account?</p>

<p>Thanks</p>
