473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Can I persist a dataset in an Application Variable

Hi,

I am writing an ASP.Net application that uses a handful of dropdown lists.
These lists appear on many of the .apx pages in the application. I would
like to persist the data that is used to populatre these dropdown lists in a
dataset, and store the datasset in an application variable. I will then
databind the drowpdownlist controls to the relevant table in the dataset.

My problem is that if I create and store the dataset in an application
variable (in the Application_OnStart Method of the global.asax file), I amm
unable to referencethe data and the tables that are contained therein.

Is it possible to do this and if so how would a reference a table in the
dataset from within an .aspx page.

TIA

Vaughn
Nov 19 '05 #1
1 1557
Does this not work?

Application_OnStart
{
Application["myDataSet"] = GetDataSet();
}

Page_Load
{
DataSet data = Application["myDataSet"] as DataSet;
ddlCity.DataSource = data.Tables["tblCities"];
ddlCity.DataBind();
}

bill
"Vaughn Haybittle" <vh********@mweb.co.za> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
Hi,

I am writing an ASP.Net application that uses a handful of dropdown lists.
These lists appear on many of the .apx pages in the application. I would
like to persist the data that is used to populatre these dropdown lists in a dataset, and store the datasset in an application variable. I will then
databind the drowpdownlist controls to the relevant table in the dataset.

My problem is that if I create and store the dataset in an application
variable (in the Application_OnStart Method of the global.asax file), I amm unable to referencethe data and the tables that are contained therein.

Is it possible to do this and if so how would a reference a table in the
dataset from within an .aspx page.

TIA

Vaughn

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Richard | last post by:
Having trouble getting Session to persist. Have checked properties of the Virtual Directory in IIS4 manager and "Enable Session State" is checked, with time out set to 20 Mins. Have also checked...
3
by: Plumer | last post by:
Good morning everyone Using C# I create a bog-standard System.Data.DataTable which I then Add to a System.Data.Dataset (At the moment I'm in the guess-and-test phase so the table has only one...
1
by: Paul Perot | last post by:
Hi All: I have a DataTable that I have defined Globally. I populate this datatable dynamically with file/folder information that I read directly from the server. I use this datatable...
2
by: Martin | last post by:
Hi! I'm new to ASP.NET WebApplications and wonder whether I've missed something out when programming it. I'm grateful for any hints to this problem! Thanks very much for your efforts! Martin...
3
by: Pat Alessi | last post by:
I want to use an XML data island to display editable records to a user on the cleint side. The user should be able to scroll through the records, modify any or all fields in any or all records, add...
1
by: Niel Mogan | last post by:
As part of my application flow when the user opt to view existing record while editing a different record I need to keep track of half edited data in the screen. I am thinking of different...
2
by: Lawrence Chang | last post by:
Hi My friends, Can I save dataset object to an application variable? I want all the customer use this dataset. and diffrent customer create diffrent dataview object from this dataset, so it...
3
by: jason | last post by:
I'll try to explain in detail what it is I'm struggling with. I created a SQL database with one table called CallSheet which contains the following columns: Caller ID: <--Primary Key, auto...
5
by: msuk | last post by:
All, I have a VB.NET/ASP.NET application that uses some common data throughout. Now what I would like to do is instead of hitting the database every time to fetch back two dataset of 5 rows 2...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.