|
-
Dec 2nd, 2004, 04:39 AM
#1
Thread Starter
Lively Member
Declaring variables
Hi,
Q1.In vb.net how can you declare a variable that works for all foms in a project whithout having to declare it in every form?
Q2. Almost the same: All my forms work with data, and in every form I have to declare a dataset and do a dataset.readxml(..). Can I do this somewhere so that it is valid for all forms automatically?
Thanks in advance.
Last edited by nacho2; Dec 2nd, 2004 at 12:54 PM.
-
Dec 2nd, 2004, 04:44 AM
#2
Hi
Q1 declare it has public
Q2) Create a class that encapsulates all the functionalities you need.
Regards
Jorge
"The dark side clouds everything. Impossible to see the future is."
-
Dec 2nd, 2004, 05:42 AM
#3
PowerPoster
Hi,
That's what Modules are for.
Declare the variables as public in a module and write the database coding in a public sub in the module.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Dec 2nd, 2004, 12:54 PM
#4
Thread Starter
Lively Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|