Link to home
Start Free TrialLog in
Avatar of UnderSeven
UnderSeven

asked on

populate datalist from sql in asp.net

There seems to be a lot of ways to do this, I was wondering if I could get some examples and perhaps quick tips to fix my code.  Currently I can see blank lines where the data should be, but no data.
ASP:
  <td align="left">
            <b>Recent Billing Activity</b><asp:imagebutton id="lnkExpand" runat="server" />:
            <asp:datalist id="ddlBills" datakeyfield="StatementNumber" runat="server" cellpadding="4" Visible="true" Width="100%">
                <HeaderTemplate>
                    <td valign="top" width="14%" align="left">
                        <b>Status</b>
                    </td>
                    <td valign="top" width="14%" align="left">
                        <b>Bill #</b>
                    </td>
                    <td valign="top" width="14%" align="left">
                        <b>Bill Date</b>
                    </td>
                    <td valign="top" width="14%" align="left">
                        <b>Due Date</b>
                    </td>
                    <td valign="top" width="14%" align="left">
                        <b>Bill AMT</b>
                    </td>
                    <td valign="top" width="14%" align="left">
                        <b>Bal Due</b>
                    </td>
                    <td valign="top" width="14%" align="left">
                        <b>PDF</b>
                    </td>
                </HeaderTemplate>
                <itemtemplate>
                    <td valign="top" width="14%" align="left">
                        <asp:Label ID="lblStatus" runat="server" />
                    </td>
                    <td valign="top" width="14%" align="left">
                        <asp:Label ID="lblStatementNumber" runat="server" />
                    </td> 
                   
                    <td valign="top" width="14%" align="left">
                        <asp:Label ID="lblStatementDate" runat="server" />
                    </td>
                    <td valign="top" width="14%" align="left">
                        <asp:Label ID="lblDueDate" runat="server" />
                    </td>
                    <td valign="top" width="14%" align="left">
                        <asp:Label ID="lblBilledAMT" runat="server" />
                    </td>
                    <td valign="top" width="14%" align="left">
                        <asp:Label ID="lblOutstandingAMT" runat="server" />
                    </td>
                    <td valign="top" width="14%" align="left">
                        <asp:HyperLink ID="HyperLink1" runat="server" Text="PDF" ImageUrl="~/Images/pdficon_small.gif" Target="_blank" />
                        <asp:HyperLink ID="lnkFormat" runat="server" Text="PDF" ImageUrl="~/Images/pdficon_small.gif" Target="_blank" />
                    </td>
                </itemtemplate>
             
            </asp:datalist>
    

Open in new window


VB:

 callFunctionStr.Connection.Open()


            callFunctionStr.CommandText = "Exec [dbo].[Cogsdale_getAllBills] '" & Left(Session("AccountNumber"), 6) & "'"

            sqladapt.SelectCommand = callFunctionStr



            sqladapt.Fill(dstable)


            repeater1.DataSource = dstable
            repeater1.DataBind()

            callFunctionStr.Connection.Close()

Open in new window


Db output:

508374-108550      2074597      2013-01-15 00:00:00.000      246.48      246.48      2013-02-14 00:00:00.000      PAY    
508374-108550      2037918      2012-10-16 00:00:00.000      400.21      0      2012-11-15 00:00:00.000      PAID    
508374-108550      2005149      2012-07-17 00:00:00.000      201.87      0      2012-08-16 00:00:00.000      PAID
ASKER CERTIFIED SOLUTION
Avatar of guru_sami
guru_sami
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of UnderSeven
UnderSeven

ASKER

Thanks, I knew I was probably overlooking something simple.