Hello all...
I need to have global data available within the lifetime of my Winform
app, accessible from any objects this application might spring at
runtime.
In ASP.NET, I can just create this holder object, put this object in
(System.Web.SessionState.HttpSessionState)Session object, and whenever
I need to access the global data from virtually any object having
access to the Session object, I just call
((HolderObjectType)Session["TheHolderObject"]).TheData
In Winform, I was hoping that I can rely on
System.Windows.Forms.Application object and put something in it.
Apparently the System.Windows.Forms.Application can't store data like
the System.Web.SessionState.HttpSessionState object.
Is there something obvious that I miss? If not, what is your
recommendation to achieve what I want?
Thanks in advance,
/john 1 2153
What's wrong with creating an internal or public class with static
properties?
Once initialized, these can be simply accessed from any object in your
AppDomain by using the classname followed by the static property name.
Cheers,
Wim Hollebrandse http://www.wimdows.com http://www.wimdows.net
"John Indra" <ma******@office.naver.co.id> wrote in message
news:75**************************@posting.google.c om... Hello all...
I need to have global data available within the lifetime of my Winform app, accessible from any objects this application might spring at runtime.
In ASP.NET, I can just create this holder object, put this object in (System.Web.SessionState.HttpSessionState)Session object, and whenever I need to access the global data from virtually any object having access to the Session object, I just call
((HolderObjectType)Session["TheHolderObject"]).TheData
In Winform, I was hoping that I can rely on System.Windows.Forms.Application object and put something in it. Apparently the System.Windows.Forms.Application can't store data like the System.Web.SessionState.HttpSessionState object.
Is there something obvious that I miss? If not, what is your recommendation to achieve what I want?
Thanks in advance,
/john This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: VijayShankar |
last post by:
Can u be more specific on your question
Anyway its not like Session variables are available for
sometime and not available for sometime.
When your session starts it is very much available...
|
by: LL |
last post by:
Hi,
Where is the best place to check the session's object, if it's null, then
redirect the user to login page?
put into every page's load event?
Thanks.
|
by: RA |
last post by:
Hi
Please review and let me know if I am correct:
1) My understanding from reading
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/
diforwc-ch05.asp is that...
|
by: Diffident |
last post by:
Hello All,
I want to display all the name-value pairs of the session object....how can
I print them out? i.e., suppose once a user logs in I set a session variable
login time Session = "2pm" and...
|
by: roland |
last post by:
When is the session object created and by which class,httpruntime or
httpapplication or sessionstateModule?
Thanks
|
by: MrShovel |
last post by:
I'm new to this ASP.NET caper and have the following questions.
I have a TestObject that contains about 50 fields of data and 3 member
procedures. Below is a simplified explanation of what I do....
|
by: |
last post by:
Simple question, I think...
I'm storing an object in the Session object.
In the code behind I read that object: trx = CType(Session("Transaction"), BOCSTransaction)
If I change any...
|
by: jyanmin.fang |
last post by:
Hi,
In my current project, I need to embed an .NET winform usercontrol in
the aspx page (via <Objecttag). This winform usercontrol has an
event called DoEvent (void DoEvent()). This winform...
|
by: Andy B |
last post by:
Is there a way to refer to things in Session object without calling Session
itself?
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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...
| |