
Originally Posted by
Marcham89
Okay thanks. Do you always need an "else" statement? (because for in this instance I know it cant be anything else)
You know, but the compiler doesnt know. That's why it's complaining.
Going back to what buser hinted at, why are you writing 12 IFs when you can just write:
Month = DateTime.Now.ToString("MMMM");
If you really must use 12 IFs, what's wrong with:
Code:
int month = DateTime.Now.Month;
if(month == 1)
..
elseif(month == 11)
..
else
..
Why convert everything to string all the time?