I have this code below and I need to set the DataTextField and the DataValueFields, how do I format my strings correctly?
Will bind to list box.
CODE
int startYear = 2009;
List<int> years = new List<int>();
for (int year = startYear; year <= DateTime.Now.Year;
year++)
{
years.Add(year);
}
this.ckBxYear.DataSource = years;
this.ckBxYear.DataTextField =
Convert.ToString(years.ToString()); <-- this is throwing an error
this.ckBxYear.Dat ...
Go to the complete details ...