Pra*_*gus 1 c# web-applications multiple-resultsets
我对c#很新.我有一个需要多个记录集的页面,以及一个返回它们的sproc.我正在使用主记录集的转发器控件.如何进入下一个返回的记录集?
好的,所以数据源在aspx页面中.我会把它移到页面后面的代码中使用NextResult吗?这是我现在的代码.如何将数据源移动到代码隐藏,实现datareader以便我可以使用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>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2287 次 |
| 最近记录: |