473,407 Members | 2,629 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,407 software developers and data experts.

Windows Forms Application

How do I make a dataset available to all forms (including dialogs) in a
Windows Form based application?

Thanks,
eXtreme
Nov 17 '05 #1
5 1478
Make it public and visible in all classes

HTH
Alex
"eXtreme" <eX*****@community.nospam> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
How do I make a dataset available to all forms (including dialogs) in a
Windows Form based application?

Thanks,
eXtreme

Nov 17 '05 #2
I made the object Public and form it is on Public but a dialog spun from
that Form is not able to see it.

Where do I check the visibility?

Thanks,
"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message
news:uH**************@TK2MSFTNGP12.phx.gbl...
Make it public and visible in all classes

HTH
Alex
"eXtreme" <eX*****@community.nospam> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
How do I make a dataset available to all forms (including dialogs) in a
Windows Form based application?

Thanks,
eXtreme


Nov 17 '05 #3
You can either pass a reference to the form to the child form, so that it
can refer to the public members.

Alternative: you can provide a static method on the form that will return
the object. You do not need a reference to the object in the calling code
to call the static method. You can just use the name of the class. This is
a Singleton.

Take a look at http://www.pobox.com/~skeet/csharp/singleton.html
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"eXtreme" <eX*****@community.nospam> wrote in message
news:ue**************@TK2MSFTNGP10.phx.gbl...
I made the object Public and form it is on Public but a dialog spun from
that Form is not able to see it.

Where do I check the visibility?

Thanks,
"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message
news:uH**************@TK2MSFTNGP12.phx.gbl...
Make it public and visible in all classes

HTH
Alex
"eXtreme" <eX*****@community.nospam> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
How do I make a dataset available to all forms (including dialogs) in a
Windows Form based application?

Thanks,
eXtreme



Nov 17 '05 #4
What's the best book I can buy, which is C# based, and would teach me about
Windows Forms and how to reference objects not in the current form?

Thanks,
eXtreme

"Nick Malik [Microsoft]" <ni*******@hotmail.nospam.com> wrote in message
news:Yf********************@comcast.com...
You can either pass a reference to the form to the child form, so that it
can refer to the public members.

Alternative: you can provide a static method on the form that will return
the object. You do not need a reference to the object in the calling code
to call the static method. You can just use the name of the class. This
is a Singleton.

Take a look at http://www.pobox.com/~skeet/csharp/singleton.html
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"eXtreme" <eX*****@community.nospam> wrote in message
news:ue**************@TK2MSFTNGP10.phx.gbl...
I made the object Public and form it is on Public but a dialog spun from
that Form is not able to see it.

Where do I check the visibility?

Thanks,
"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message
news:uH**************@TK2MSFTNGP12.phx.gbl...
Make it public and visible in all classes

HTH
Alex
"eXtreme" <eX*****@community.nospam> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
How do I make a dataset available to all forms (including dialogs) in a
Windows Form based application?

Thanks,
eXtreme



Nov 17 '05 #5
Hi eXtreme,

For winform books, I'd recommend Chris Cells's

#Windows Forms Programming in C#
http://www.amazon.com/exec/obidos/tg...824083-4872945
?v=glance

Also, there're many good tech articles in MSDN

#Windows Forms Programming in C#
http://msdn.microsoft.com/library/en...Anchor.asp?fra
me=true

In addition, as for the
===============
how to reference objects not in the current form?
===============
you mentioned, I think it depends on the objects/data's role and
functionality in your app. Is it usefule and accessiable from all the forms
in your app? If it's a global data, I think you can consider Nick 's
suggestion on using a singleton class which hold the goblal object
references so that we can Access those objects/datas from any form or
class's code. Since your scenario is winform(clientside app) , we don't
need to worry too much about cocurrecy issues.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Nov 17 '05 #6

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

Similar topics

15
by: Wiktor Zychla | last post by:
today we've found a critical issue regarding the ListView from Windows.Forms. it was confirmed on several machines with Win2K and XP. here's the problem: create a ListView with about 50000 rows....
6
by: Ayende Rahien | last post by:
Excetremely annoying problem, I've an application with a long startup time. So I created another form with my logo in it to as a splash screen. The splash screen is run from another thread and is...
9
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am...
1
by: Günther Rühmann | last post by:
Hi, I´m not sure if i´m right int this group... My problem: I made a vb .net application that reads from AD via System.Directoryservices.Directoryentry. The appliocation enumerates group...
5
by: david | last post by:
I have developed my web service with a domain name of my computer name and wwwroot directory. I also developed a client of windows form application. It works locally (i.e. in the same machine). ...
1
by: harinathch | last post by:
Hi, Iam working with myapplication.exe.config file in my vb.net windows application.Its working fine in my development environment. When i test this application in some other machine using exe and...
4
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
15
by: =?Utf-8?B?TVNU?= | last post by:
To demonstrate my problem, I have a very simple VB Windows application. It has a text box that is used to display a counter, a button to reset the counter, and a timer that increments the counter...
21
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters...
3
by: shobhitguptait | last post by:
How to Run C#.NET Windows App on N/W with centralized DB using SQL SERVER 2000 Hello All...i m really grate full to c such a website where developers try to help people like us who face problems...
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
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?
1
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...
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
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...

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.