Phil Sando

  Home  |   Contact  |   Syndication    |   Login
  13 Posts | 0 Stories | 3 Comments | 0 Trackbacks

News

Twitter












Archives

Image Galleries

Here is the markup for the repeater control and its templates:

<asp:Repeater ID="Repeater" runat="server">
<HeaderTemplate>
<table>
<tr>
<td colspan="3"><h2>Header information:</h2></td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%#Container.DataItem%></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>

 Here is the code to populate it with data:

  SQLString = "select something from foo where something"
            SQLCommand = New SqlCommand(SQLString, SQLConnection)
            SQLConnection.Open()
            SQLDReader = SQLCommand.ExecuteReader
            If SQLDReader.HasRows Then
                Contactinforepeater.DataSource = SQLDReader
                Contactinforepeater.DataBind()
            End If
        End If
        SQLConnection.Close()
        SQLDReader.Close()

posted on Thursday, April 22, 2010 9:56 AM