Beispiel #1
0
        //Insert Case-Shiller Composite-20 Not Seasonally Adjusted
        public void InsertSPCS20RNSA(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 = m.SPCS20RNSA(); // 20rnsa

            f = "NULL"; // 20rpsnsa

            g = "NULL"; // 10rsa

            h = "NULL"; // 10rnsa

            i = "NULL"; // 10rpsnsa

            if (e == "DNF")
            {
                ListBox1.Text += "SPCS20RNSA 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 SPCS20RNSA. \n", a);
                }
                catch { UpdateSPCS20RNSA(e, a, ListBox1); }
            }
        }