Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Selecting first N rows in DataView

Selecting first N rows in DataView

Scheduled Pinned Locked Moved ASP.NET
question
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rachitdamani
    wrote on last edited by
    #1

    HI All, I have a requirement where I need to select first N rows from DataView. So how could i achieve this? Thanks, Rachit Damani.

    E 1 Reply Last reply
    0
    • R rachitdamani

      HI All, I have a requirement where I need to select first N rows from DataView. So how could i achieve this? Thanks, Rachit Damani.

      E Offline
      E Offline
      enjoycrack
      wrote on last edited by
      #2

      use SELECT TOP N... << >>

      8x Solutions Ltd

      R 1 Reply Last reply
      0
      • E enjoycrack

        use SELECT TOP N... << >>

        8x Solutions Ltd

        R Offline
        R Offline
        rachitdamani
        wrote on last edited by
        #3

        Thanks for your reply but how i could use select query in dataview? i don't need to select top N rows when i am fetching the data from the database but at some point of time i need to select top N rows from dataview which contains all the data. so is it possible to use select query in dataview? Thanks, Rachit Damani.

        E 1 Reply Last reply
        0
        • R rachitdamani

          Thanks for your reply but how i could use select query in dataview? i don't need to select top N rows when i am fetching the data from the database but at some point of time i need to select top N rows from dataview which contains all the data. so is it possible to use select query in dataview? Thanks, Rachit Damani.

          E Offline
          E Offline
          enjoycrack
          wrote on last edited by
          #4

          for this...you can loop thru the dataview to get the top n records Or better: Add a column on the datatable, set it's autoincrement value, include it in the rowfilter for the dataview Hope you get the idea << >>

          8x Solutions Ltd

          R 1 Reply Last reply
          0
          • E enjoycrack

            for this...you can loop thru the dataview to get the top n records Or better: Add a column on the datatable, set it's autoincrement value, include it in the rowfilter for the dataview Hope you get the idea << >>

            8x Solutions Ltd

            R Offline
            R Offline
            rachitdamani
            wrote on last edited by
            #5

            ya thanks, now i have understood what i need to do thanks a lot Rachit Damani.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups