Connection String (MDI forms)

I'm new to dotNetand  want to know whether connection created for an MDI parent form can be used by all of its child forms without recreating connections.
Many thanks.
Derry


Answer this question

Connection String (MDI forms)

  • Jalal Y. Marzouq

    Singleton Info...

    http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnbda/html/singletondespatt.asp



    Breifly  it is a way to ensure that your object has only a single instance...


    Public Class MyClass
      Private m_Singleton as object
       Public Function MySingleton as object
           If IsNothing(m_Singleton) then
                  m_Singleton = New Object
                  return m_Singleton
            else
               return m_Singleton
           end if
       end function
    end class

     
       

  • John Hensley

    Might not be the best design, but it is possible yes.

    Expose the Connection as a public property. You MDI children, assuming their immediate parent is the MDI Parent form, will need to cast the Parent property to Your form to access it.

    You could also use a Singleton model to expose this connection to everybody.

  • Chris D Jones

    Kindly let me know what the singleton model is or lead me to resources that can thorougly explain the model to me.

    Many thanks

  • Connection String (MDI forms)