Results 1 to 3 of 3

Thread: Number of rows returned by SQL query

  1. #1
    Join Date
    Apr 2009
    Posts
    4

    Number of rows returned by SQL query

    Can you please tell me if there is another way to get a specific number of rows from a query other than Top N?

    How two application (two exe files) can comunicate between them in a workspace?

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Number of rows returned by SQL query

    I have one method for you.You can use a counter variable to do this

    SQLDataReader dr = new SQLDataReader();
    int counter = 0;
    while ( dr.Read() )
    {
    counter +=;
    }
    Response.Write ( "Number of records is: " + counter );

    Good luck !!

  3. #3
    Join Date
    May 2008
    Posts
    271

    Re: Number of rows returned by SQL query

    Why don't you use something like selecting the columns in SELECT clause, from the table in FROM clause, then providing the condition that the starting "N" rows are excluded in WHERE clause.

    Example:

    SELECT * FROM table_name
    WHERE intPrimaryId > "n"

Similar Threads

  1. Replies: 2
    Last Post: 09-07-2009, 08:57 AM
  2. Turn on MySQL query cache to speed up query performance
    By DMA2Superman in forum Software Development
    Replies: 3
    Last Post: 07-07-2009, 10:26 AM
  3. How do i automatically number rows in Excel 2007
    By Atilla in forum Windows Software
    Replies: 3
    Last Post: 21-04-2009, 10:48 AM
  4. Limit Rows Returned In Access Query
    By NetWorm in forum Software Development
    Replies: 4
    Last Post: 25-02-2009, 10:32 PM
  5. VB.NET Datareader to display number of rows?
    By Pooja in forum Software Development
    Replies: 3
    Last Post: 14-02-2009, 06:29 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,635,069.15614 seconds with 16 queries