Accessing a dataset from another form

Ok, I'm not sure if this is the correct way on how to do this, but here is what I want to do.  

When my main form loads, I want to read in an xml document into XMLDataset, which I can do.  But I want to only read this document in once when the app loads.  Then whenever another form needs the dataset it can access the already read in dataset, instead of taking the time to read in the document again.  

How can I do this   

I'm not sure if I have explained what I want to do clearly or not, leave me questions if I haven't.  


Answer this question

Accessing a dataset from another form

  • bri5

    Expose the data to the other forms through a shared property in the mainform or a property in a module
  • SamCKayak

    Thanks. It works
  • whs45

    I tried with Shared in Module it is giving me error

    Module MoGlobal
        Public dsActiveAlarms As DataSet
    End Module

    I tried both

    Module MoGlobal
        Public shared dsActiveAlarms As DataSet
    End Module

  • kenlefeb

    Try:


    Public Module MoGlobal 
        Public dsActiveAlarms As DataSet 
    End Module 

  • Accessing a dataset from another form