コード例 #1
0
        /// <summary>
        /// Init the handler, loads the config file and creates the log table if needed.
        /// </summary>
        public override void Init(HandlerConfig oConfig)
        {
            lock (_monitor)
            {
                m_sConfigFile = FixConfigPath(oConfig.ConfigFile);

                m_oConfig     = (SQLDBHandlerConfig)LoggerUtils.XMLSerializer.DeserializeObjectFromFile(typeof(SQLDBHandlerConfig), m_sConfigFile);
                m_sConnString = string.Format(m_sConnString, m_oConfig.Server, m_oConfig.Database, m_oConfig.User, m_oConfig.Password);

                if (m_oConfig.DateFormat != "")
                {
                    m_sSql = "SET DateFormat " + m_oConfig.DateFormat + ";" + m_sSql;
                }

                if (m_oConfig.AutoGenerateTable)
                {
                    CreateTable();
                }
            }
        }
コード例 #2
0
ファイル: SQLDBHandler.cs プロジェクト: Jusharra/RMS
        /// <summary>
        /// Init the handler, loads the config file and creates the log table if needed.
        /// </summary>
        public override void Init(HandlerConfig oConfig)
        {
            lock (_monitor)
            {
                m_sConfigFile = FixConfigPath(oConfig.ConfigFile);

                m_oConfig = (SQLDBHandlerConfig)LoggerUtils.XMLSerializer.DeserializeObjectFromFile(typeof(SQLDBHandlerConfig), m_sConfigFile);
                m_sConnString = string.Format(m_sConnString, m_oConfig.Server, m_oConfig.Database, m_oConfig.User, m_oConfig.Password);

                if (m_oConfig.DateFormat != "")
                    m_sSql = "SET DateFormat " + m_oConfig.DateFormat + ";" + m_sSql;

                if (m_oConfig.AutoGenerateTable)
                    CreateTable();
            }
        }