Solved

VB .NET: sharing datasets across multiple forms

Posted on 2004-10-13
1
284 Views
Last Modified: 2011-10-03
I would like to create all the database connections on the parent forms onload event, and then be able to access all the datasets thus generated by all the children forms (or most of them anyway).

What is the most efficient and most elegant way of sharing datasets across multiple forms?
0
Comment
Question by:majnun
1 Comment
 
LVL 8

Accepted Solution

by:
bramsquad earned 500 total points
ID: 12299395
across multiple forms, youll want to create the variables in a startup module.

if you are not familiar, all you need to do is create a module with a Sub Main() call, and goto Project -> Properties and then select Sub Main() as your startup object.

for a good procedure to follow concerning starting from a module, check out RonaldBiemans answer to this question.

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21146363.html

after you have that, simply declare the variable public at the top of the module.  

youll now have access to it from any form you create.

~b

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Protecting vb6 & .Net code Obfuscation 18 97
Help with Query not working in client's PC 1 35
SQL syntax in VB.net 5 30
Put window Form inside tab page 10 26
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now