Using the cast operator, it converts just fine on SQL Server. Other DBs
might handle it different, though.
--
- Nicholas Paldino [.NET/C# MVP]
-
(E-Mail Removed)
"Jon Skeet [C# MVP]" <(E-Mail Removed)> wrote in message
news:679379f7-4b2d-4755-b37b-(E-Mail Removed)...
On Jul 1, 9:24 am, "Jacek Jurkowski" <jjurkow...@data-comp.eu> wrote:
> How to make it in c#:
>
> if("20080101" < "20080201")
> {
> do somethink...
>
> }
>
> All dates in my old application (VFP/SQL) are Char 8.
> For compatibility reasons i have to keep that
> way but how to work with that in c#? F.e. how to use Linq?
>
> var query = from K_PEOPLES in DC.PEOPLES_TABLE where PEOPLES.BITRHDAY <
> (???) SELECT PEOPLES;
>
> I don't want to convert string to DateTime every time ...
Well, you could use String.CompareTo:
if("20080101".CompareTo("20080201") < 0)
I wouldn't like to say whether that will translate nicely into SQL,
admittedly...
Jon