Пример #1
0
        private void _store_candles(string fstr, string d2)
        {
            DataTable dic = default(DataTable);

            QuandlAPI.QuandlError err = default(QuandlAPI.QuandlError);
            WnF_DBType            dbt = (WnF_DBType)Properties.Settings.Default.dbms;
            string cstr;

            err = _api.GetCandlesTable(fstr, d2, out dic, _tname);
            if (err != null)
            {
                Console.WriteLine("[QuandlChart._store_candles()] GetCandlesTable failed...\r\n" + err.message);
                return;
            }

#if DEBUG
            dynamic watch = System.Diagnostics.Stopwatch.StartNew();
#endif
            cstr = string.Format(Properties.Settings.Default.dbConn, _database);
            using (WnFDbConnectionWrapper dbcw = WnFDbConnectionWrapper.GetWrapper(dbt, cstr))
                dbcw.InsertTable(dic);

#if DEBUG
            watch.Stop();
            Console.WriteLine("[QuandlChart._store_candles()] " + dic.Rows.Count + " ellapsed " + watch.ElapsedMilliseconds);
#endif
            dic = null;
        }
Пример #2
0
 private void _set_dbconn(WnFDbConnectionWrapper wrpper)
 {
     _dbc_wr_owner = (wrpper == null);
     if (wrpper == null)
     {
         _dbc_wr = WnFDbConnectionWrapper.GetWrapper((WnF_DBType)Properties.Settings.Default.dbms, string.Format(Properties.Settings.Default.dbConn, _database));
     }
     else
     {
         _dbc_wr = wrpper;
     }
 }