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. Conversion to Hashtable or other

Conversion to Hashtable or other

Scheduled Pinned Locked Moved ASP.NET
sysadmin
4 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.
  • B Offline
    B Offline
    bubberz
    wrote on last edited by
    #1

    Here's my code: Shared offset As Integer Public Function GetPN(reset As Boolean, pagenumber As Integer) As Integer If reset offset = pagenumber - 1 End If Return pagenumber - offset End Function This is for a report page number reset on a new grouping value. Since the offset must be shared (so that this will work across multiple callbacks to the server), if more than one person runs the report at the same time they’ll smash each other. I need to modify the offset to be a hashtable, and am not sure how I would.....or if there's another possible route. Thanks!

    G 1 Reply Last reply
    0
    • B bubberz

      Here's my code: Shared offset As Integer Public Function GetPN(reset As Boolean, pagenumber As Integer) As Integer If reset offset = pagenumber - 1 End If Return pagenumber - offset End Function This is for a report page number reset on a new grouping value. Since the offset must be shared (so that this will work across multiple callbacks to the server), if more than one person runs the report at the same time they’ll smash each other. I need to modify the offset to be a hashtable, and am not sure how I would.....or if there's another possible route. Thanks!

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Put it in a session variable. --- b { font-weight: normal; }

      B 1 Reply Last reply
      0
      • G Guffa

        Put it in a session variable. --- b { font-weight: normal; }

        B Offline
        B Offline
        bubberz
        wrote on last edited by
        #3

        Not sure where I'm going wrong, or really how to go about this, but here's what I have so far. I'm still a little new to session objects. I'm getting: Expression is not an array or method, and cannot have an arguement list. Shared offset As Integer Public Function GetPN(ByVal reset As Boolean, ByVal pagenumber As Integer) As Integer If reset Then offset(Session("report")) = pagenumber - 1 End If Return pagenumber - offset End Function Thanks!

        G 1 Reply Last reply
        0
        • B bubberz

          Not sure where I'm going wrong, or really how to go about this, but here's what I have so far. I'm still a little new to session objects. I'm getting: Expression is not an array or method, and cannot have an arguement list. Shared offset As Integer Public Function GetPN(ByVal reset As Boolean, ByVal pagenumber As Integer) As Integer If reset Then offset(Session("report")) = pagenumber - 1 End If Return pagenumber - offset End Function Thanks!

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          Remove the static variable. It's not thread safe, so it won't work.

          Public Function GetPN(ByVal reset As Boolean, ByVal pagenumber As Integer) As Integer
          If reset Then
          Session("report") = pagenumber - 1
          End If
          Return pagenumber - Session("report")
          End Function

          --- b { font-weight: normal; }

          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