Hello everyone
I'm very bad, and I just started coding again - So bare with me.
I'm trying to build a little project/case managing app for my work but I'm having some trouble sorting an access database properbly.
I created several sorting buttons which work great, but I also want to sort by any dates before todays date - So projects that are over the due-date.
I'm trying to use this
I'm getting this error on line 3:
It works great with simple text like
Anyone got an idea on how to do this?
Alternately how to search for projects that have due-dates before the current date and mark alle the text in that row red?
TL;DR: I need help sorting a table/Access databasse by dates in cells - trying above examples.
Hope someone can help !
Have a great day.
Regards
I'm very bad, and I just started coding again - So bare with me.
I'm trying to build a little project/case managing app for my work but I'm having some trouble sorting an access database properbly.
I created several sorting buttons which work great, but I also want to sort by any dates before todays date - So projects that are over the due-date.
I'm trying to use this
C#:
string todayDate = DateTime.Today.ToString("MM/dd/yyyy");
DataView dv;
dv = new DataView(sagstyringDBDataSet.Tables[2], "forfaldsdato = 'todayDate' ", "forfaldsdato Desc", DataViewRowState.CurrentRows);
dataGridView1.DataSource = dv;
I'm getting this error on line 3:
Exception Unhandled line 3:
System.Data.EvaluateException: 'Cannot perform '=' operation on System.DateTime and System.String.'
It works great with simple text like
C#:
DataView dv;
dv = new DataView(sagstyringDBDataSet.Tables[2], "Status = '5. Afventer' ", "Status Desc", DataViewRowState.CurrentRows);
dataGridView1.DataSource = dv;
Alternately how to search for projects that have due-dates before the current date and mark alle the text in that row red?
TL;DR: I need help sorting a table/Access databasse by dates in cells - trying above examples.
Hope someone can help !
Have a great day.
Regards