i'm having trouble correctly sorting dates in my dataview. It will sort the column but it just sorts according to the month number. I need to display the data on my companies site with the most recent enteries first.
Here is my code:
Sub Page_Load(Source as Object, E as EventArgs)
Dim ds As New DataSet
ds.ReadXml(Server.MapPath("xml_files/news.xml"))
Dim dv As New DataView(ds.Tables("text"))
dv.Sort = "linetext DESC"
dg.DataSource = dv
dg.DataBind()
End Sub
</script>
The xml file is set up as follows:
<news>
<text>
<date>2/4/2001</date>
<linetext>blahblah blah</>
</text>
</news>
do you have any suggestions? I was thinking trying to convert the date to a julian date or if there is some way to get the sort function to work here.
This is the first time Ive messed with this stuff so I could use some help.