Tamer_Ahmed
Centurion
hi all i'm trying to bing datareader to datalist and here's my code
Dim cn As New SqlConnection("data source = localhost;initial catalog = northwind;integrated security = sspi;")
Dim cm As New SqlCommand("select firstname,lastname from employees", cn)
Dim dr As SqlDataReader
cn.Open()
dr = cm.ExecuteReader
DataList1.DataSource = dr
DataList1.DataBind()
dr.Close()
cn.Close()
well i create table and put it in the iteam template of the datalist
<aspataList id="DataList1" style="Z-INDEX: 102; LEFT: 16px; POSITION: absolute; TOP: 48px" runat="server" RepeatColumns="3" Height="258px" Width="304px" RepeatDirection="Horizontal">
<ItemTemplate>
<TABLE id="Table1" style="Z-INDEX: 101; LEFT: 8px; WIDTH: 296px; POSITION: absolute; TOP: 8px; HEIGHT: 64px" cellSpacing="1" cellPadding="1" width="296" border="1">
<TR>
<TD style="WIDTH: 101px"><STRONG>First Name :</STRONG></TD>
<TD>
<%# DataBinder.Eval(Container.DataItem, "FirstName") %>
</TD>
</TR>
<TR>
<TD style="WIDTH: 101px"><STRONG>Last Name :</STRONG></TD>
<TD>
<%# DataBinder.Eval(Container.DataItem, "LastName") %>
</tr>
</Table>
</ItemTemplate>
the problem here that i want to show in every row 3 column and every column contain this table and this is not what happening here it put all the table in the same place hope anyone can help
Dim cn As New SqlConnection("data source = localhost;initial catalog = northwind;integrated security = sspi;")
Dim cm As New SqlCommand("select firstname,lastname from employees", cn)
Dim dr As SqlDataReader
cn.Open()
dr = cm.ExecuteReader
DataList1.DataSource = dr
DataList1.DataBind()
dr.Close()
cn.Close()
well i create table and put it in the iteam template of the datalist
<aspataList id="DataList1" style="Z-INDEX: 102; LEFT: 16px; POSITION: absolute; TOP: 48px" runat="server" RepeatColumns="3" Height="258px" Width="304px" RepeatDirection="Horizontal">
<ItemTemplate>
<TABLE id="Table1" style="Z-INDEX: 101; LEFT: 8px; WIDTH: 296px; POSITION: absolute; TOP: 8px; HEIGHT: 64px" cellSpacing="1" cellPadding="1" width="296" border="1">
<TR>
<TD style="WIDTH: 101px"><STRONG>First Name :</STRONG></TD>
<TD>
<%# DataBinder.Eval(Container.DataItem, "FirstName") %>
</TD>
</TR>
<TR>
<TD style="WIDTH: 101px"><STRONG>Last Name :</STRONG></TD>
<TD>
<%# DataBinder.Eval(Container.DataItem, "LastName") %>
</tr>
</Table>
</ItemTemplate>
the problem here that i want to show in every row 3 column and every column contain this table and this is not what happening here it put all the table in the same place hope anyone can help