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
---------
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
------
<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" />