Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i want paging concept.
Customer table have 30 records.
in customer paging concepts display only 10 to 19 records.
every time text box taken only no 2.pls solve this problem
-----------------------------------------------------------------
cs code
-------
private void BindCustGrid(string cust_code, string cust_name)
{
QBEL.page = TextBox2.Text;

QBEL.cust_code = cust_code;
QBEL.cust_name = cust_name;
DataSet dsResult = QBLL.Customer_GetData(QBEL);
grid_customer.DataSource = dsResult;
grid_customer.DataBind();
TextBox txtSCustCode = (TextBox)grid_customer.HeaderRow.FindControl("txtSCustCode");
TextBox txtSCustName = (TextBox)grid_customer.HeaderRow.FindControl("txtSCustName");
txtSCustCode.Text = cust_code;
txtSCustName.Text = cust_name;
}
--------------------------------------------------------------------
Procedure
---------
SQL
CREATE PROCEDURE SP_Customer_GetData (@page int,@ccode varchar(50),@cname varchar(50))
AS
BEGIN
declare @start int,@finish int
set @start=0
set @finish=10
set @start=((@page-1)*9)+1
set @finish=@start+9
SELECT * FROM (SELECT row_number() OVER (ORDER BY cust_id ASC)AS rownum, cust_id, cust_code, cust_name,cust_address1 FROM customers where cust_deleted=0 and (cust_code like @ccode+'%' and cust_name like @cname+'%'))AS A
WHERE A.rownum BETWEEN @start AND @finish
END

----------------------------------------------------------------------
Design
------
XML
<asp:ImageButton ImageUrl ="Images/astart.png" ID="ImageButton3" runat="server" Width="20px" Height="20px" OnClick="Img_Custstart_Click" ImageAlign="AbsBottom" />
                       <asp:ImageButton alt="" src="Images/aprev.png"  ID="ImageButton4" runat="server" Width="20px" Height="20px" OnClick="Img_Custprev_Click"  ImageAlign="AbsBottom" />
                       <asp:TextBox ID="TextBox2" runat="server" Width="18px"></asp:TextBox>
                       <asp:Label ID="Label4" runat="server" Text=" Of "></asp:Label>
                       <asp:ImageButton alt=""  src="Images/anext.png"  ID="ImageButton5" runat="server" Width="20px" Height="20px" OnClick="Img_Custnext_Click" ImageAlign="AbsBottom"  />
                       <asp:ImageButton alt=""  src="Images/afinish.png"  ID="ImageButton6" runat="server" Width="20px" Height="20px" OnClick="Img_Custfinish_Click"  ImageAlign="AbsBottom" />
Posted
Comments
DamithSL 6-Oct-15 2:08am    
why not debug and check your application?
check all the places where you set or read values from TextBox2
Member 10928697 6-Oct-15 2:15am    
ok sir.
ZurdoDev 6-Oct-15 10:48am    
What?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900