Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Paging BLL Return Value Help

Status
Not open for further replies.

Soteriologist

Programmer
May 26, 2006
9
US
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:parameter Name="maximumRows" Type="Int32" DefaultValue="10" />
<asp:parameter Name="totalRows" Type="Int32" Direction="Output" />
</SelectParameters>
</asp:ObjectDataSource>
 
Right under my nose... I was trying to pass totalRows as just a value (ByVal) instead of by reference (ByRef).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top