?
Solved

VB .NET: sharing datasets across multiple forms

Posted on 2004-10-13
1
Medium Priority
?
311 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 8

Accepted Solution

by:
bramsquad earned 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

762 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