Filter dataset by Date?
I have a datagrid displaying entries by users showing user, amount of time, date entered, and description bound to a dataset. Im trying to filter the dataset on the DateTime column but get an error. Here's the code:
private void dgSummaryFilter(string SortColumn, string strFilter)
{
// Apply filter to the Job Summary dataset, enable button to remove filter, and bind Job Summary datagrid
if (SortColumn=="TimeStamp")
{
Global.dsJobSummary.Tables[0].DefaultView.RowFilter = SortColumn + " = " + strFilter;
}
else
{
Global.dsJobSummary.Tables[0].DefaultView.RowFilter = SortColumn + " LIKE '*" + strFilter + "*'";
}
btnShowAll.Enabled=true;
dgSummary.DataSource = Global.dsJobSummary.Tables[0].DefaultView;
dgSummary.DataBind();
}
Im pretty sure its to do with the filter string on the datetime column. How do i concatenate the string?
|