【发布时间】:2009-06-16 17:07:55
【问题描述】:
我对 c# 很陌生。 我有一个需要多个记录集的页面,以及一个返回它们的存储过程。我正在对主记录集使用中继器控件。如何进入下一个返回的记录集?
好的,所以数据源在 aspx 页面中。我会把它移到页面后面的代码来使用 NextResult 对吗?这是我现在的代码。如何将数据源移动到代码隐藏,实现数据读取器以便我可以使用 nextresult?
<asp:SqlDataSource ID="AssetMgtSearch" runat="server"
ConnectionString="<%$ ConnectionStrings:OperationConnectionString %>"
SelectCommand="spAssetMgtItemList" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>
<div class="contentListFullHeight">
<table cellspacing="0" cellpadding="0" border="0" class="contentList">
<tr>
<th>ShipmentID/</td>
<th>MaterialID/</td>
<th>ItemID/</td>
</tr>
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="AssetMgtSearch">
<ItemTemplate>
<tr>
<td colspan="3" style="border-top:solid thin blue"> </td>
</tr>
<tr>
<td><%#Container.DataItem(0)%></td>
<td><%#Container.DataItem(1)%></td>
<td><%#Container.DataItem(2)%></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
【问题讨论】:
标签: c# web-applications multiple-resultsets