Global Dataset
-
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.
-
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.
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.
-
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.
-
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.