Justice75
asked on
Get the value of SelectCountMethod
Hi All,
Does anyone know how to get the value of the SelectCountMethod in an ObjectDataSource and add it to the header of a GridView and a textbox? I am using a BLL, DAL, C#. There is some sample code. Any help would be greatly appreciated.
Jus
Does anyone know how to get the value of the SelectCountMethod in an ObjectDataSource and add it to the header of a GridView and a textbox? I am using a BLL, DAL, C#. There is some sample code. Any help would be greatly appreciated.
Jus
The code from the DAL is:
SELECT COUNT(*)
FROM phone_Makes
=========================================================
The code from the BLL is:
public int TotalNumberOfMakes()
{
return Adapter.TotalNumberOfMakes().GetValueOrDefault();
}
==========================================================
The code from the ObjectDataSoure:
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
SelectMethod="GetMakesPagesAndSorted"
TypeName="MakesBLL"
EnablePaging="True"
OldValuesParameterFormatString="original_{0}"
SelectCountMethod="TotalNumberOfMakes"
SortParameterName="sortExpression">
<SelectParameters>
</SelectParameters>
</asp:ObjectDataSource>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Clear, concise and straight to the point!
ASKER
Also, When I added it to the Columns[2] it replaced the header text for that column. Is there any way that it can go on the row with the paging mechanism?
Jus
Jus
ASKER
Thank you for your response. Should that be in the GridView1_Load method or some other one? Thank you.. This worked perfect.
Jus