Beispiel #1
0
        public fmSearchEngine()
        {
            InitializeComponent();

            FileIsChosen += OnFileIsChosen;
            SearchBegin  += OnSearchBegin;
            SearchEnd    += OnSearchEnd;


            if (Connection != null)
            {
                Connection.Close();
            }
            Connection = DBConnection.GetInstance(GetConnectionString());
        }
Beispiel #2
0
        // The bulk of the clean-up code is implemented in Dispose(bool)
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                // free managed resources
                _dbConnection.Close();

                _dbConnection.Dispose();
            }
            // free native resources here if there are any
        }
Beispiel #3
0
        private void LoadDataFromDB(bool ReconnectFlag = true)
        {
            if (ReconnectFlag || Connection == null)
            {
                if (Connection != null)
                {
                    Connection.Close();
                }
                Connection = DBConnection.GetInstance(GetConnectionString());
            }

            string sql = "SELECT [Id],[Content] FROM [dbo].[Pages];";

            Connection.Open();
            DataTable dt = Connection.ExecuteQuery(sql);

            Connection.Close();

            DocumentCorpus.Adapter(dt);
        }
Beispiel #4
0
        // The bulk of the clean-up code is implemented in Dispose(bool)
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                lock (_dbConnection)
                {
                    _dbConnection.Close();

                    _dbConnection.Dispose();
                }
            }
            // free native resources here if there are any
        }
Beispiel #5
0
 public void Close()
 {
     sqlConnection.Close();
 }