前台
<%--按订单查询货物--%>
<asp:DataList ID="DataList1" runat="server" CellPadding="4" ForeColor="#333333">
<AlternatingItemStyle BackColor="White" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<ItemStyle BackColor="#EFF3FB" />
<SelectedItemStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<HeaderTemplate>
<table>
<tr>
<td style="width:80px"><repeater>运单号</repeater></td>
<td style="width:500px"><repeater>到达地点</repeater></td>
<td style="width:100px"><repeater>到达时间</repeater></td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table>
<tr>
<td style="width:80px"><asp:Label ID="yundan" runat="server" Text='<%# Bind("yundanhao") %>'>dsfsdfsdf</asp:Label><br /></td>
<td style="width:500px"><asp:Label ID="daodadi" runat="server" Text='<%# Bind("daodaplace") %>'></asp:Label><br /></td>
<td style="width:100px"><asp:Label ID="daodashijian" runat="server" Text='<%# Bind("daodatime") %>'></asp:Label><br /></td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
<%--以上按订单查询货物--%>
后台绑定数据
string yundansqlstr = "select yundanhao,daodaplace,daodatime from T_genzong where yundanhao = " + yundanhao.Trim() + "";//按运单号查询数据
DataSet ds1 = leiFile.SqlHelper.GetDataSet(yundansqlstr);
DataList1.DataSource = ds1;
DataList1.DataBind();