473,396 Members | 2,039 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.

Stay alive, data! Where to put datasets for global access?

36
I think I've somehow missed a basic design principle for storing data from databases.

What is the "correct" way to store data that your whole application needs access to, regardless of which forms are open or which class is reading the data? I would like to store datasets apart from forms, but don't know how to create them in their own space so that they can be referenced in code at design time.

When I started programming, I was using the AppDomain for everything but realized that it isn't designed for holding a whole database. I use per-table SQL Select statements when I need to load data, am extending my subs to also do per-ID-range SQL Selects for reloading chunks of a table, and the AppDomain doesn't work the way I though it did.

My other idea is using My.Settings to store datasets, in addition to configuration options. Would that work? I wouldn't want to keep the datasets when closing the program.
Jun 30 '09 #1
4 1832
PRR
750 Expert 512MB
You can use Cache to store your dataset.
Expand|Select|Wrap|Line Numbers
  1. DataSet ds;
  2. //Fill DataSet
  3.  
  4.         Cache["globalDS"] = ds;
  5.  
  6.         DataSet ds1 = Cache["globalDS"] as DataSet;
  7.         //OR
  8.         ds1 = (DataSet)Cache["globalDS"];
  9.  
Jul 1 '09 #2
Curtis Rutland
3,256 Expert 2GB
PRR, that will only work if he is using ASP.NET.

I'm guessing that you're using VB.NET? You could define the DataSet as a Shared property of the class that loads the data.
Jul 1 '09 #3
PRR
750 Expert 512MB
Yes, i assumed the application would be asp.net. Shared/Static DataSet would do the trick... thanks for pointing out :)...
Jul 1 '09 #4
Infog
36
Thank you! Yes, I'm using VB.NET.

Aha! so THAT is what shared means. :) Making my datasets part of a module or shared class should do the trick then.
Jul 1 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Anand Pillai | last post by:
I would like to add a feature to one of my network programs. The requirement is to find out if a server is alive by sending it requests. I know of the standard ICMP ping, and searched for python...
0
by: John | last post by:
Hi I am using the Internet Transfer Control as follows; strData = "Some data" strHeaders = "Content-Type: application/x-www-form-urlencoded" & vbCrLf objInet.Execute strURL, "POST",...
0
by: John | last post by:
Hi I am trying to use the internet transfer control to send some data to a site. I want my MS ISA proxy server to keep the connection alive. What syntax should I use to send the 'keep alive'...
7
by: Sigfried Manner | last post by:
Hello NG! I have following situation: c-prg | webprg "c-prg" is a small c-programm which reads data from an fastCgi-Server and writes them to stdout. The stdout is piped into webprg....
1
by: cppdev | last post by:
Hello, After reading a few articles, http://blogs.gotdotnet.com/cbrumme/PermaLink.aspx/e55664b4-6471-48b9-b360-f0fa27ab6cc0...
1
by: Nuno Magalhaes | last post by:
With the sniffer ethereal I get a lot of Connections Keep Alive in some sites like google.com and that returns me the Content-Length in the HTTP response header. When the connection is Close I...
1
by: t.mitchell | last post by:
Hi, I have a python gtk app that allows users to have one project open at a time. I have recently discovered that projects are not being freed when they are closed - the refcount is not hitting...
6
by: laredotornado | last post by:
Hi, When a user logs into our site, we create a session variable to denote the session is active and another to denote who is logged in. Once the user closes the browser and re-opens it, the...
2
by: MikeP | last post by:
Hi there, This is actually (probably) a C# or .NET issue. I'm working on an VS 2005 AddIn and at one point I'm caching all "EnvDTE80.ErrorItem" objects that result from compiling one or more...
0
by: richard.krehbiel | last post by:
I've been googling for half a day now and have found answers on both sides of the argument. Baiscally it's this: I am using PHP 5.0.4 (I can upgrade if that's a solution) as an ISAPI module under...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.