Just create a public class with a static member of type DataSet, along these
lines:
public Globals {
private static DataSet ds = null;
public static DataSet GlobalDataSet {get {return this.ds;}}
public static Globals() {
// Create the DataSet here. This will run the first time you access
// the GlobalDataSet property (or some other static property you
// might define in this class)
}
}
In your code, you simply reference it like this:
DoSomethingWith (Globals.Global DataSet);
--Bob
"Benny Raymond" <be***@pocketro cks.com> wrote in message
news:uG******** ******@TK2MSFTN GP15.phx.gbl...
I have a program that has a main form and several modeless forms. I'd like
to access the same dataset that is loaded when the main form loads from all
of the forms - How to do this? In vb.net I just used a module to start up
the main form - that module loaded in the dataset - I couldn't figure out
how to use the same method in C#
~Benny