Example #1
0
        /// <summary>
        /// Purpose: Initializes class members.
        /// </summary>
        private void InitClass()
        {
            // create all the objects and initialize other members.
            m_scoMainConnection             = new SqlConnection();
            m_bMainConnectionIsCreatedLocal = true;
            m_cpMainConnectionProvider      = null;
            AppSettingsReader m_asrConfigReader = new AppSettingsReader();

            // Set connection string of the sqlconnection object
            m_scoMainConnection.ConnectionString =
                m_asrConfigReader.GetValue("BFPCntStr", typeof(string)).ToString();
            m_iErrorCode  = (int)Error.AllOk;
            m_bIsDisposed = false;
        }
Example #2
0
 /// <summary>
 /// Purpose: Implements the Dispose functionality.
 /// </summary>
 protected virtual void Dispose(bool bIsDisposing)
 {
     // Check to see if Dispose has already been called.
     if (!m_bIsDisposed)
     {
         if (bIsDisposing)
         {
             // Dispose managed resources.
             if (m_bMainConnectionIsCreatedLocal)
             {
                 // Object is created in this class, so destroy it here.
                 m_scoMainConnection.Close();
                 m_scoMainConnection.Dispose();
                 m_bMainConnectionIsCreatedLocal = false;
             }
             m_cpMainConnectionProvider = null;
             m_scoMainConnection        = null;
         }
     }
     m_bIsDisposed = true;
 }
Example #3
0
        /// <summary>
        /// Purpose: Initializes class members.
        /// </summary>
        private void InitClass()
        {
            // create all the objects and initialize other members.
            m_scoMainConnection = new SqlConnection();
            m_bMainConnectionIsCreatedLocal = true;
            m_cpMainConnectionProvider = null;
            AppSettingsReader m_asrConfigReader = new AppSettingsReader();

            // Set connection string of the sqlconnection object
            m_scoMainConnection.ConnectionString =
                m_asrConfigReader.GetValue("BFPCntStr", typeof(string)).ToString();
            m_iErrorCode = (int)Error.AllOk;
            m_bIsDisposed = false;
        }
Example #4
0
 /// <summary>
 /// Purpose: Implements the Dispose functionality.
 /// </summary>
 protected virtual void Dispose(bool bIsDisposing)
 {
     // Check to see if Dispose has already been called.
     if(!m_bIsDisposed)
     {
         if(bIsDisposing)
         {
             // Dispose managed resources.
             if(m_bMainConnectionIsCreatedLocal)
             {
                 // Object is created in this class, so destroy it here.
                 m_scoMainConnection.Close();
                 m_scoMainConnection.Dispose();
                 m_bMainConnectionIsCreatedLocal = false;
             }
             m_cpMainConnectionProvider = null;
             m_scoMainConnection = null;
         }
     }
     m_bIsDisposed = true;
 }