Vulpes
posted
5419 posts
since
Feb 28, 2011
from
|
|
Re: DatePicker with Linq
|
|
|
|
|
|
|
|
|
|
|
As long as the types are compatible, I'd guess that it should be:
where n.recordedtime = dpLatestDate.SelectedDate
|
|
|
|
|
|
C B
posted
12 posts
since
Aug 19, 2010
from
UK
|
|
Re: DatePicker with Linq
|
|
|
|
|
|
|
|
|
|
Thanks Vulpes I have tried this and got an error i.e. Cannot implicitly convert type 'System.DateTime?' to 'bool'. I have checked the SQL server and the column is set at recordedtime (datetime, null). At the moment I am a bit lost. Thanks for your time. Cheers C
|
|
|
|
|
Its only bloody obvious when you know how!
|
|
|
|
|
|
Vulpes
posted
5419 posts
since
Feb 28, 2011
from
|
|
Re: DatePicker with Linq
|
|
|
|
|
|
|
|
|
|
|
Doh, just noticed that we're using the assignment rather than the equality operator - hence the latest error.
That clause should be:
where n.recordedtime == dpLatestDate.SelectedDate
|
|
|
|
|
|
C B
posted
12 posts
since
Aug 19, 2010
from
UK
|
|
Re: DatePicker with Linq
|
|
|
|
|
|
|
|
|
|
|
Thanks Vulpes
I'm the one who should be goind Doh. I am a newbie but I do have some experience with C# and should have worked that one out.
However, in my defence, I spent the morning working with VBA and you only use the singe '='. So I was still in VBA mode, thats my excuse and I am sticking to it. I can stop swearing at my computer and relax.
My phrase rings very true "Its only bloody obvious when you know how!"
Thanks for your time.
Cheers
C
|
|
|
|
|
Its only bloody obvious when you know how!
|
|
|
|
|
|
Vulpes
posted
5419 posts
since
Feb 28, 2011
from
|
|
Re: DatePicker with Linq
|
|
|
|
|
|
|
|
|
|
It's easily done and sometimes you just can't see it - particularly if you use VB as well.
At least C# does tell you there's an error. It's not always an error in C/C++ which can lead to some hard to find bugs which may not surface until after you've deployed the application!
|
|
|
|
|
|