我在数据库中有 2 个表 w/c 已连接
tblPackage
id Name
1 Package A
2 Package B
tblDetails
id PackageID Details
1 1 PackageDetails11
2 1 PackageDetails12
3 1 PackageDetails13
4 1 PackageDetails14
5 2 PackageDetails21
6 2 PackageDetails22
7 2 PackageDetails23
现在我希望它在中继器上操纵它
HTML
<asp:Repeater ID="rptrPackage" runat="server">
<ItemTemplate>
<asp:Label id="Pack" runat="server" Text='<%# Bind("Pack") %>'></asp:Label>
<asp:BulletedList id="Details" runat="server">
</asp:BulletedList>
</ItemTemplate>
</asp:Repeater>
ASP
private void Populate()
{
DataTable dtPackage = tblPackage();
DataTable dtDetails = tblDetails();
rptrPackage.DataSource = dtPackage;
rptrPackage.DataBind();
}