Solved

VB .NET: sharing datasets across multiple forms

Posted on 2004-10-13
1
301 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 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 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