The line that is throwing the error:
DropDownList5.Items.Add(i.ToString() );
Has only two parts that use a method:
i.ToString()
And
DropDownList5.Items.Add(...);
The first is using an integer, which is not a nullable type, so it can't be that.
The second is using a collection of an object - if the object exists, then it will always have an Items Collection (because it is constructed as part of the DropDownList constructor) so the only nullable object is
DropDownList5
Look at your other code - you need to work out how you get into the
days
method withput a value in
DropDownList5
- where do you set it's value? What do you set it to? What are you doing when you call
days
?
Use the debugger - examine your stack trace, and look at the variables involved.
We can't solve this - you have the information we don't!