c# drop down box error

Posted on 2012-08-21
Last Modified: 2012-08-21
getting error on following code:

Error      54      The best overloaded method match for 'System.Web.UI.WebControls.ListItemCollection.Add(System.Web.UI.WebControls.ListItem)' has some invalid arguments      C:\Development\ELT\TitleTec.ELT.Web\SignUp\SignUp.aspx.cs      392      17      TitleTec.ELT.Web

 DateTime dt = DateTime.Now; ;
            //int currYear = Year(Now());
            int currYear = Convert.ToInt32(dt.Year.ToString());
            for (i = currYear; i <= currYear + 10; i++)
Question by:Meinhoonaa
    1 Comment
    LVL 18

    Accepted Solution

    try this,
      DateTime dt = DateTime.Now; ;
            //int currYear = Year(Now());
            int currYear = Convert.ToInt32(dt.Year.ToString());
            for (int i = currYear; i <= currYear + 10; i++)

    Open in new window


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now