Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4039786
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:39:47+00:00 2026-05-20T12:39:47+00:00

As need to display Records in grid view in (ASP.NET) web site. and for

  • 0

As need to display Records in grid view in (ASP.NET) web site. and for the same i am using Procedure to return Data to .net Net Framework.

As my problem is that i need table set with return me the no of ROW’s (Data) for the curr. Page. and i also need total no of row for paging (To display no of pages).

And for the same i have writen the following is the procedure which i have return

    CREATE PROCEDURE usp_SearchEmp(IN _RowIndex int, IN _MaxRows int , IN _SortByCol  varchar(40),IN _EmployeeID int)
 DECLARE _getLastSequenceNumberSQL VARCHAR(4000);
set _getLastSequenceNumberSQL ='
    SELECT SQL_CALC_FOUND_ROWS 
    @rownum:=@rownum+1 ROW,
        E.EmployeeID,
        E.EmployeeName  
    from
    (SELECT @rownum:=0) r, Employee E ;
        IF (_EmployeeID IS NOT NULL) THEN
              set _getLastSequenceNumberSQL = concat(_getLastSequenceNumberSQL,' WHERE (E.EmployeeID=',_EmployeeID,')');
        END IF;

        IF (_SortByCol IS NOT NULL) AND (_SortByCol != "") THEN
              set @SortCol = concat(' ORDER BY ', _SortByCol) ;
        ELSE
               set @SortCol = 'ORDER BY EmployeeName';
        END IF;

      set _getLastSequenceNumberSQL = concat(_getLastSequenceNumberSQL, @SortCol , ' LIMIT ',  _RowIndex, ' , ' , _MaxRows,' ');

 SET @getLastSequenceNumberSQL = _getLastSequenceNumberSQL;

  prepare lastRecordStmt from @getLastSequenceNumberSQL;
  execute lastRecordStmt;
  deallocate prepare lastRecordStmt;

    select FOUND_ROWS() as i;

But now the problem is that when i call this Procedure from .net it return me only the result of Found_Rows ..

 I need out put . some thing like the following 

like :-

SELECT 64 AS `ROWMAX`, E.EmployeeID, E.EmployeeName FROM Employee E order by EmployeeID LIMIT 0 , 4

|--------------------------------------------------------------|

| ROWMAX  | EmployeeID | EmployeeName                          |

|--------------------------------------------------------------|

|  64     |    1       | Emp One                               |

|  64     |    2       | Emp Two                               |

|  64     |    3       | Emp Three                             |

|  64     |    4       | Emp Four                              |

----------------------------------------------------------------

as i can user ROWMAX column to justified No. of Pages in grid view.

So please guide me out for the same. as i am new to MYSQL

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T12:39:48+00:00Added an answer on May 20, 2026 at 12:39 pm

    we can use other PROCEDURE Which will be call from MainProcedure(let say Main Procedure).

    let says ProcedureCound it will contain Pr build sql query ” SELECT COUNT(*) “
    and will accept two parameter (argument)

    1) will be out parameter
    2) will be From condition which is dynamic generated. in Main Procedure.

    so now need to append second argument which contains from condition.which we got from Main Procedure..
    and stored the result in to out parameter which we can access back into Main Procedure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im working on a grid view in asp.net mvc 3 and I need to
I've got an web app in ASP.NET 2.0 in which I need to do
I need to display a grid on a webpage. The data will come from
I am developing a web application that will display data in grid form. I
I need a Telerik grid to only display records where the date recorded matches
We need to display the result of an SQL SELECT statement on a ASP.NET
i am developing one application with map view i need display the weather depends
I need to display short description like label and near it data associated with
I need to display a certain view when an activity starts, and when the
I need to display array of images in a single view which have various

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.