When binding data to a datalist/gridview/repeater its easier to just create as list of objects and bind that to the control. Here's an example using a gridview:
<asp:GridView ID="GridView1" runat="server" AllowSorting="False"
AutoGenerateColumns="false" BackColor="White"
BorderWidth="2px" BorderStyle="Solid"
CellPadding="4" ForeColor="#333333" GridLines="both"
EmptyDataText="No Log Messages">
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<Columns>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Center" HeaderText="ID" HeaderStyle-ForeColor="white">
<ItemTemplate>
<asp:Label ID="lblId" runat="Server" Text=' <%#Eval("ID")%>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Center" HeaderText="Address" HeaderStyle-ForeColor="white">
<ItemTemplate>
<asp:Label ID="lblAddress" runat="Server" Text=' <%#Eval("Address1")%>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
This example creates a table with two columns. Each column is expecting a coresponding data source to have columns with names: ID and Address1. On the server side, you create a list of objects which have columns with these names and you bind the datasource to the control. Like this:
First, create a class with your properties:
Public Class myClassAddress
Public Property ID As String
Public Property Address1 As String
End Class
Now, in the code behind where you have the gridview, instantiate that class and fill it:
Dim myList As New List(Of myClassAddress)
Dim newClass As myClassAddress
newClass = New myClassAddress
newClass.Address1 = "some address"
newClass.ID = "1"
myList.Add(newClass)
newClass = New myClassAddress
newClass.Address1 = "some address2"
newClass.ID = "12"
myList.Add(newClass)
Of course, in this example I am just hard coding the values. You can fill a class with data from a database, xml file, etc. The above example creates two instance of your myClassAddress class. It also creates a list of these classes and adds each instantiation to that list. Now, just bind the list to your control:
me.gridView1.datasource = myList
me.gridview1.bindData()
I know this may seem like a lot but once you get use to it, it's the easiest way to bind data to these types of controls. If you have any questions, let me know.