public MarketCapitalizationSettings GetMarketCapitalization(ref string strError)
        {
            MarketCapitalizationSettings marketcap = new MarketCapitalizationSettings();

            try
            {
                using (var conn = new SQLiteConnection(ConnectionString))
                using (var cmd = conn.CreateCommand())
                {
                    conn.Open();
                    cmd.CommandText = "SELECT * FROM MarketCapitalization WHERE MarketCapitalizationPK = 1";
                    using (var reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            marketcap = new MarketCapitalizationSettings() { Source = reader.GetString(reader.GetOrdinal("Source")), RefreshRate = reader.GetInt32(reader.GetOrdinal("RefreshRate")) };
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                strError = ex.Message;
            }

            return marketcap;
        }
        public MarketCapitalizationSettings GetMarketCapitalization(ref string strError)
        {
            MarketCapitalizationSettings marketcap = new MarketCapitalizationSettings();

            MarketCapitalizationData data = new MarketCapitalizationData();
            marketcap = data.GetMarketCapitalization(ref strError);

            return marketcap;
        }
 public void UpdateMarketCapitalization(MarketCapitalizationSettings marketcap, ref string strError)
 {
     MarketCapitalizationData data = new MarketCapitalizationData();
     data.UpdateMarketCapitalization(marketcap, ref strError);
 }
 public void UpdateMarketCapitalization(MarketCapitalizationSettings marketcap, ref string strError)
 {
     try
     {
         using (var conn = new SQLiteConnection(ConnectionString))
         using (var cmd = new SQLiteCommand("UPDATE MarketCapitalization SET Source = @Source, RefreshRate = @RefreshRate WHERE MarketCapitalizationPK = 1", conn))
         {
             conn.Open();
             cmd.Parameters.Add(new SQLiteParameter("@Source", marketcap.Source));
             cmd.Parameters.Add(new SQLiteParameter("@RefreshRate", marketcap.RefreshRate));
             cmd.ExecuteNonQuery();
         }
     }
     catch (Exception ex)
     {
         strError = ex.Message;
     }
 }