Beispiel #1
0
        //Insert S&P Case-Shiller 20-City Home Price Sales Pair Counts
        public void InsertSPCS20RPSNSA(System.Web.UI.WebControls.ListBox ListBox1)
        {
            string a, b, c, d, e, f, g, h, i;

            FRED m = new FRED();

            a = m.getDate(); // date

            b = "Arizona"; // stateName

            c = "NULL"; // all-transactions HPI

            d = "NULL"; // 20rsa

            e = "NULL"; // 20rnsa

            f = m.SPCS20RPSNSA(); // 20rpsnsa

            g = "NULL"; // 10rsa

            h = "NULL"; // 10rnsa

            i = "NULL"; // 10rpsnsa

            if (f == "DNF")
            {
                ListBox1.Text += "SPCS20RPSNSA up to date! \n";
            }

            else
            {
                try
                {
                    String query = String.Format("INSERT INTO state_stats VALUES('{0}', '{1}', {2}, {3}, {4}, '{5}', {6}, {7}, {8})", a, b, c, d, e, f, g, h, i);

                    //create command and assign the query and connection from the constructor
                    MySqlCommand cmd = new MySqlCommand(query, connection);

                    //Execute command
                    cmd.ExecuteNonQuery();

                    ListBox1.Text += String.Format("{0} has been updated with SPCS20RPSNSA. \n", a);
                }
                catch { UpdateSPCS20RPSNSA(f, a, ListBox1); }
            }
        }