The object name is wrong:
...
MySqlCommand mycom1 = new MySqlCommand(insquery1, exclecon);
mycom1.Parameters.AddWithValue("@MONTH", MONTH);
mycom1.Parameters.Add("@contenttype", MySqlDbType.VarChar).Value = contenttype;
...
This is why it is a really bad practice to use such variable names with a running index at the end. Use a descriptive variable name, don't be lazy: IntelliSense is doing the most of the work. And do't mix statements that belong to each other, and don't use variables you don't really need - you make your code unreadable. I wound organize this code snippet like this:
MySqlConnection exclecon = new MySqlConnection("Server=Localhost;DataBase=password1;user=root;password=nectar");
exclecon.Open();
MySqlCommand cmdYear = new MySqlCommand("INSERT INTO slayear (YEAR) VALUES(@YEAR)", exclecon);
cmdYear.Parameters.AddWithValue("@YEAR", YEAR);
cmdYear.ExecuteNonQuery();
MySqlCommand cmdMonth = new MySqlCommand("INSERT INTO slamonth (MONTH,contenttype) VALUES(@MONTH,@contenttype)", exclecon);
cmdMonth.Parameters.AddWithValue("@MONTH", MONTH);
cmdMonth.Parameters.Add("@contenttype", MySqlDbType.VarChar).Value = contenttype;
cmdMonth.ExecuteNonQuery();
exclecon.Close();