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. EOF in Dataset

EOF in Dataset

Scheduled Pinned Locked Moved ASP.NET
csharp
6 Posts 3 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
    Rock Star
    wrote on last edited by
    #1

    In ASP where recordsets has AbsolutePosition and EOF/BOF. So How I know its the last record in a DataSet. I can´t find EOF and BOF properties of dataset. This is my asp code which I wnat to convert to asp .net if not rsThmModel.EOF then here rsThmodel is a record set

    Rock Star

    modified on Wednesday, July 9, 2008 7:02 AM

    M 1 Reply Last reply
    0
    • R Rock Star

      In ASP where recordsets has AbsolutePosition and EOF/BOF. So How I know its the last record in a DataSet. I can´t find EOF and BOF properties of dataset. This is my asp code which I wnat to convert to asp .net if not rsThmModel.EOF then here rsThmodel is a record set

      Rock Star

      modified on Wednesday, July 9, 2008 7:02 AM

      M Offline
      M Offline
      meeram395
      wrote on last edited by
      #2

      for (int i=0; i<=DataSet1.Tables[0].Rows.Count-1; i++) // This will read till the EOF correctly. { // Write your logic here. } Hope this helps.

      Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

      R 1 Reply Last reply
      0
      • M meeram395

        for (int i=0; i<=DataSet1.Tables[0].Rows.Count-1; i++) // This will read till the EOF correctly. { // Write your logic here. } Hope this helps.

        Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

        R Offline
        R Offline
        Rock Star
        wrote on last edited by
        #3

        I prforming some operation on the end of the record in the dataset.I dont want to use a loop. Is there any property in the dataset like EOF?

        Rock Star

        M 1 Reply Last reply
        0
        • R Rock Star

          I prforming some operation on the end of the record in the dataset.I dont want to use a loop. Is there any property in the dataset like EOF?

          Rock Star

          M Offline
          M Offline
          meeram395
          wrote on last edited by
          #4

          There is no property called EOF in dataset. Either you have to check it in the loop or you have to check with a property called HasRows. Again this will go for a minor loop, like If (DataSet1.Tables[0].Rows.Count > 0) { //Write your logic here. }

          Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

          R 1 Reply Last reply
          0
          • M meeram395

            There is no property called EOF in dataset. Either you have to check it in the loop or you have to check with a property called HasRows. Again this will go for a minor loop, like If (DataSet1.Tables[0].Rows.Count > 0) { //Write your logic here. }

            Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

            R Offline
            R Offline
            Rock Star
            wrote on last edited by
            #5

            I think i will give me the number of records in a dataset. What I want to do is do some operation wen I am at the last record. For i = 0 To demodataset.Tables(0).Rows.Count - 1 For j = 1 To 3 ---- Here I want a if condition that if there is no data in a dataset then no need to do the following action --------- id = demodataset.Tables(0).rows("id")

            Rock Star

            I 1 Reply Last reply
            0
            • R Rock Star

              I think i will give me the number of records in a dataset. What I want to do is do some operation wen I am at the last record. For i = 0 To demodataset.Tables(0).Rows.Count - 1 For j = 1 To 3 ---- Here I want a if condition that if there is no data in a dataset then no need to do the following action --------- id = demodataset.Tables(0).rows("id")

              Rock Star

              I Offline
              I Offline
              Imran Khan Pathan
              wrote on last edited by
              #6

              If you want to get Last record from the dataset then you can go this way

              int LastIndex=demodataset.Tables(0).Rows.Count - 1

              Now you can get last record from the dataset using this lastindex

              id = demodataset.Tables(0).rows(LastIndex)("id")

              regard kHan

              please don't forget to vote on the post that helped you.

              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