Link_1 11 Light Poster

How to create a datalist table layout in vb?

I am using vb .net

I have a following data:

DataBase: databaseName
Table : tableName

--------------------
| ID | randomNames |
--------------------
| 1  | name1       |
| 2  | name2       |
| 3  | name3       |
| 4  | name4       |
| 5  | name5       |
| 6  | name6       |
--------------------

I want to take all the data from database and display datalist table in the following format.

------------------------
|name1 | name2 | name3 |
|name4 | name5 | name6 |
------------------------

I set up the code but having hard time understand how to create the above table layout?

   <asp:DataList ID="dlCustomers" runat="server" DataSourceID="SqlDataSource1" RepeatColumns = "3" RepeatLayout = "Table">
        <ItemTemplate>
            <table class = "table">
                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
            </table>
        </ItemTemplate>
    </asp:DataList>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:constr %>"
        SelectCommand="SELECT TOP 6 * FROM tableName"></asp:SqlDataSource>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.