62,182
社区成员
发帖
与我相关
我的任务
分享
<asp:Repeater ID ="repeaterSub" runat ="server" DataSource=<%# Bind(DataBinder.Eval(Container,"B_ID"))%> >
<ItemTemplate > <table style="width: 100px">
<tr>
<td style="width: 100px"> <%#DataBinder.Eval(Container, "DataItem.small_name")%>
</td>
</tr>
</table> </ItemTemplate> </asp:Repeater>
//后台
public DateSet Bind(string strClassID)
{
string strSQL2 = "select small.small_name from small,big where ";
strSQL2 += " (small.B_ID=big.B_ID and big.B_ID=" + strClassID + ") or (small.B_ID=big.B_ID and big.ParentID=" + strClassID + ")";
SqlDataAdapter da2 = new SqlDataAdapter(strSQL2, cn);
ds = new DataSet();
da2.Fill(ds, "WZ");
return ds;
}
<asp:Repeater ID ="repeaterSub" runat ="server" DataSource=<% Bind(DataBinder.Eval(Container,"B_ID"))%> >
<ItemTemplate > <table style="width: 100px">
<tr>
<td style="width: 100px"> <%#DataBinder.Eval(Container, "DataItem.small_name")%>
</td>
</tr>
</table> </ItemTemplate> </asp:Repeater>