Soteriologist
Programmer
In Scott Guthrie's article titled “Efficient Data Paging with the ASP.NET 2.0 DataList Control and ObjectDataSource” he returns his total rows in the same SPROC as his rows of data. He suggests this as a performance optimization and so I’m trying to utilize it. But In his example his ObjectDataSource directly accesses the DAL. I’ve implemented it this way and it works great. But when I try to have my ObjectDataSource use a BLL I’ve setup for my DAL my “totalRows” are getting returned as “0”. How do I properly setup my BLL to return my totalRows???
This is my BLL code:
Public Function Test_Select(ByVal TestID As Integer, ByVal startRowIndex As Integer, ByVal maximumRows As Integer, ByVal totalRows As Integer) As Test_DAL.Test_DataTable
Return Adapter.Test_Select(TestID, startRowIndex, maximumRows, totalRows)
End Function
And here is my ASPX code:
<asp:ObjectDataSource ID="ObjDS_Test" runat="server" TypeName="Test_BLL" SelectMethod="Test_Select" OldValuesParameterFormatString="original_{0}">
<SelectParameters>
<asp:QueryStringParameter Name="TestID" QueryStringField="CseID" Type="Int32" DefaultValue="-99999" />
<asp:QueryStringParameter Name="startRowIndex" QueryStringField="Index" Type="Int32" DefaultValue="0" />
<asp
arameter Name="maximumRows" Type="Int32" DefaultValue="10" />
<asp
arameter Name="totalRows" Type="Int32" Direction="Output" />
</SelectParameters>
</asp:ObjectDataSource>
This is my BLL code:
Public Function Test_Select(ByVal TestID As Integer, ByVal startRowIndex As Integer, ByVal maximumRows As Integer, ByVal totalRows As Integer) As Test_DAL.Test_DataTable
Return Adapter.Test_Select(TestID, startRowIndex, maximumRows, totalRows)
End Function
And here is my ASPX code:
<asp:ObjectDataSource ID="ObjDS_Test" runat="server" TypeName="Test_BLL" SelectMethod="Test_Select" OldValuesParameterFormatString="original_{0}">
<SelectParameters>
<asp:QueryStringParameter Name="TestID" QueryStringField="CseID" Type="Int32" DefaultValue="-99999" />
<asp:QueryStringParameter Name="startRowIndex" QueryStringField="Index" Type="Int32" DefaultValue="0" />
<asp
<asp
</SelectParameters>
</asp:ObjectDataSource>