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. General Programming
  3. Visual Basic
  4. Global Dataset

Global Dataset

Scheduled Pinned Locked Moved Visual Basic
csharpdatabasevisual-studio
4 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.
  • L Offline
    L Offline
    liona
    wrote on last edited by
    #1

    I am using Visual Studio 2003. I am wondering if I can have a global dataset. The ideal thing I would want is when someone opens this web application I would want the app then to connect to the database and haul down a table to be stored in a dataset. Then I want to be able to use this dataset anywhere in my application. Reason I am asking is that I will need to refer to this table numerous times over the run of the application and rather than having numerous connections or leaving open a connection I would rather store the dataset in a global variable for quick use.

    K N L 3 Replies Last reply
    0
    • L liona

      I am using Visual Studio 2003. I am wondering if I can have a global dataset. The ideal thing I would want is when someone opens this web application I would want the app then to connect to the database and haul down a table to be stored in a dataset. Then I want to be able to use this dataset anywhere in my application. Reason I am asking is that I will need to refer to this table numerous times over the run of the application and rather than having numerous connections or leaving open a connection I would rather store the dataset in a global variable for quick use.

      K Offline
      K Offline
      Kschuler
      wrote on last edited by
      #2

      If you are working with a web app I'm not sure a global dataset is the solution. You are going to have all kinds of problems when multiple users access it at the same time. A global variable in a web project is a single variable for everyone who uses it...not a variable for a single user on a single session. I would suggest that instead you make a global method to run queries/procedures to your database. In these global methods you can include the code to open and close a single connection so you will always be sure to only have one open and you will not leave it open when you are not using it. I hope this helps.

      1 Reply Last reply
      0
      • L liona

        I am using Visual Studio 2003. I am wondering if I can have a global dataset. The ideal thing I would want is when someone opens this web application I would want the app then to connect to the database and haul down a table to be stored in a dataset. Then I want to be able to use this dataset anywhere in my application. Reason I am asking is that I will need to refer to this table numerous times over the run of the application and rather than having numerous connections or leaving open a connection I would rather store the dataset in a global variable for quick use.

        N Offline
        N Offline
        nlarson11
        wrote on last edited by
        #3

        i haven't tried it personally but I think you can use cache for this. do some research on it...

        1 Reply Last reply
        0
        • L liona

          I am using Visual Studio 2003. I am wondering if I can have a global dataset. The ideal thing I would want is when someone opens this web application I would want the app then to connect to the database and haul down a table to be stored in a dataset. Then I want to be able to use this dataset anywhere in my application. Reason I am asking is that I will need to refer to this table numerous times over the run of the application and rather than having numerous connections or leaving open a connection I would rather store the dataset in a global variable for quick use.

          L Offline
          L Offline
          liona
          wrote on last edited by
          #4

          Figured it out Thanks.

          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