public Datatable DynamicDataTable { DataTable dt = new DataTable(); dt.Columns.Add("year", typeof(string)); DataRow dr = null; for (int i = 2005; i <= DateTime.Now.Year; i++) { dr = dt.NewRow(); dr["year"] = i.ToString() + "-" + (i+1).ToString().Substring(2); dt.Rows.Add(dr); } return dt; }
No comments:
Post a Comment