Within my datalist, I want to create a separation dividing each ItemTemplate with a new year, when a different year occurs.
I select my data using:
MySqlDataAdapter adapter = new MySqlDataAdapter("SELECT * FROM code_post", dbcon);
And within this field, a date denotes the year it was created. For instance 2011, 2010, 2009.
How can I make a heading of a new year division when a different year occurs?
The way I solved this was by making one trip to the database, and having the code such as
and inside the item template i did
This allows for one trip to the DB, and is far more efficent/flexible than the previously suggest methods