string SQL="Select Count (ID) As rcount From TbProduct WHERE every (" + ids +") AND IN PRODUCTNAME LIKE '%' + '%' + @ PRODUCTNAME ";
OleDbParameter []=new SPS OleDbParameter [1];
[0]=AccessDB. SPS CreateParameter (" @ ProductName "OleDbType VarChar, ProductName, 50, ParameterDirection. Input);
int resultCount=(int) AccessDB. ExecuteScalar (SQL, SPS);
recordCount=resultCount;
if (resultCount >=0)
{
if ((pageSize resultCount %)==0)
{
=pageCount resultCount/pageSize;

} else
{
pageCount=(resultCount/pageSize) + 1;
}
if (pageIndex==1)
{
SQL="Select Top" + pageSize. ToString () + "* From TbProduct WHERE every (" + ids +") AND IN PRODUCTNAME LIKE '%' + '%' + @ PRODUCTNAME Order by desc "ID;

} else
{
int minRecord=(pageIndex - 1) * pageSize;
SQL="Select Top" + pageSize. ToString () + "* From TbProduct Where ID Not In (Select ID From (Select Top" + minRecord. ToString () + "ID From TbProduct Where every (" + ids +") AND In PRODUCTNAME LIKE '%' + '%' + @ PRODUCTNAME Order by desc) ID TemA) AND every (" + ids + ") AND In PRODUCTNAME LIKE '%' + '%' + @ PRODUCTNAME Order by desc "ID;

}}
the else
{
pageCount=0; .

} return AccessDB ExecuteDataSet (SQL, SPS) Tables [0];

you might be interested in the article:

  • oracle, mysql, essentially three instances of paging query database
  • three paging query SQL stored procedure code
  • PHP mysql paging query use opportunely select statement under
  • generated parameterized SQL injection prevention general paging query statement
  • SQL Server query paging stored procedure code
  • database paging query method
  • paging query efficiency highest
  • efficient JSP pagination queries
  • real efficient essentially a paging query (various)


This concludes the body part