By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,566 Members | 1,774 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,566 IT Pros & Developers. It's quick & easy.

Compatibility reasons ...

P: n/a
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 ...

Jul 1 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Jul 1, 9:24*am, "Jacek Jurkowski" <jjurkow...@data-comp.euwrote:
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
Jul 1 '08 #2

P: n/a
Using the cast operator, it converts just fine on SQL Server. Other DBs
might handle it different, though.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:67**********************************@k13g2000 hse.googlegroups.com...
On Jul 1, 9:24 am, "Jacek Jurkowski" <jjurkow...@data-comp.euwrote:
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
Jul 1 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.