Beispiel #1
0
        /// <summary>
        /// mehod to open  the connection to the data base
        /// </summary>
        public void Open()
        {
            try
            {
                // calling method from DBManagerFactory class to get the provider type connection object
                idbConnection = DBManagerFactory.GetConnection(this.providerType);

                // passing connection string
                idbConnection.ConnectionString = this.ConnectionString;

                if (idbConnection.State == ConnectionState.Open)
                {
                    idbConnection.Close();
                }

                // chek for open connection state
                if (idbConnection.State != ConnectionState.Open)
                {
                    idbConnection.Open();
                }
                // calling method from DBManagerFactory class to get the provider type command object
                this.idbCommand     = DBManagerFactory.GetCommand(this.ProviderType);
                this.idbTransaction = DBManagerFactory.GetTransaction(idbConnection, this.ProviderType);
            }
            catch (Exception ex)
            { throw ex; }
        }