I
Ieuan
I have noticed this problem coming up in newsgroups before I have a
slightly different variation on it.
I have a dataview (dv) that I am filtering:
e.g.
strFilter = "EndDateTime >= '" + txtEndDateFrom.Text + "')";
dv.RowFilter = strFilter
Now, on my computer and one one of my servers this works fine and the
filter filters as requested.
However, on our production server, I get the message "Cannot perform
'>=' operation on System.DateTime".
I've tried many things including having the filter being
strFilter = "EndDateTime >= " +
Convert.ToDateTime(txtEndDateFrom.Text).ToShortDateString()) + "')";
strFilter = "EndDateTime >= #" + txtEndDateFrom.Text + "#)";
strFilter = "EndDateTime >= #" +
Convert.ToDateTime(txtEndDateFrom.Text) + "#)";
strFilter = "EndDateTime >= '#" +
Convert.ToDateTime(txtEndDateFrom.Text) + "#')";
For the ones above I tend to get String not recognised as valid
datetime.
So, I've got 2 servers that'll happily run this code and the
production one doesn't.
The only obvious difference in these servers is although the
production server has the .Net framework installed (same version as
the other 2), the production server doesn't have Visual Studio .Net
installed on it. I really can't see why this would matter and would
rather take the task of installing VS.Net on the server as a last
thing to try.
So, anyone out there got any suggestions as to why the code runs
differently?
Thanks,
Ieuan Roberts
slightly different variation on it.
I have a dataview (dv) that I am filtering:
e.g.
strFilter = "EndDateTime >= '" + txtEndDateFrom.Text + "')";
dv.RowFilter = strFilter
Now, on my computer and one one of my servers this works fine and the
filter filters as requested.
However, on our production server, I get the message "Cannot perform
'>=' operation on System.DateTime".
I've tried many things including having the filter being
strFilter = "EndDateTime >= " +
Convert.ToDateTime(txtEndDateFrom.Text).ToShortDateString()) + "')";
strFilter = "EndDateTime >= #" + txtEndDateFrom.Text + "#)";
strFilter = "EndDateTime >= #" +
Convert.ToDateTime(txtEndDateFrom.Text) + "#)";
strFilter = "EndDateTime >= '#" +
Convert.ToDateTime(txtEndDateFrom.Text) + "#')";
For the ones above I tend to get String not recognised as valid
datetime.
So, I've got 2 servers that'll happily run this code and the
production one doesn't.
The only obvious difference in these servers is although the
production server has the .Net framework installed (same version as
the other 2), the production server doesn't have Visual Studio .Net
installed on it. I really can't see why this would matter and would
rather take the task of installing VS.Net on the server as a last
thing to try.
So, anyone out there got any suggestions as to why the code runs
differently?
Thanks,
Ieuan Roberts