コード例 #1
0
        public FormParameters_DB(ConnectionSettings connSett) : base()
        {
            m_connSett = connSett;

            int err        = -1;
            int idListener = DbSources.Sources().Register(m_connSett, false, TepCommon.CONN_SETT_TYPE.MAIN_DB.ToString());

            m_dbConn = DbSources.Sources().GetConnection(idListener, out err);

            if ((!(m_dbConn == null)) && (err == 0))
            {
                loadParam(true);
            }
            else
            {
                ;
            }

            DbSources.Sources().UnRegister(idListener);

            if ((m_dbConn == null) || (!(err == 0)))
            {
                m_dbConn = null;

                throw new Exception(@"Нет связи с БД конфигурации");
            }
            else
            {
                ;
            }

            m_dbConn = null;
        }
コード例 #2
0
 public void InitConnectionSettings(ASUTP.Database.ConnectionSettings connSett)
 {
     _connSett = connSett;
 }