コード例 #1
0
        public static List <List <string> > Execute(EngineQuery EQ)
        {
            string connStr = "server="
                             + EQ.server
                             + ";user="******";database="
                             + EQ.database
                             + ";port=3306;password="******"select"))
                {
                    while (rdr.Read())
                    {
                        List <string> tackon = new List <string>();

                        short ii = 0;

                        while (ii < rdr.FieldCount)
                        {
                            tackon.Add(rdr[ii].ToString());
                            ii++;
                        }

                        ret.Add(tackon);
                    }
                }

                rdr.Close();
            }
            catch (MySql.Data.MySqlClient.MySqlException pwex)
            {
                throw pwex;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }

            conn.Close();

            return(ret);
        }
コード例 #2
0
        public static void WriteYCA(EngineQuery eq, string amnt)
        {
            eq.query = "INSERT INTO `stockplanner`.`yearly_contribution` (`write_date`, `yearly_contribution_amount`) VALUES(" +
                       "'" + timenow() + "'," +
                       amnt +
                       ");"
            ;

            Execute(eq);

            eq.query = "";
        }
コード例 #3
0
        public static bool CheckPW(EngineQuery eq)
        {
            try
            {
                eq.query = "SELECT * FROM stockplanner.view_portfolio;";

                Execute(eq);
            }
            catch
            {
                return(false);
            }

            return(true);
        }