Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Am I tired ?
Message
De
13/02/2008 17:47:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
13/02/2008 02:50:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01291041
Message ID:
01292431
Vues:
25
>Hi,
>
>( I have my ADSL break for 2 days ... )
>
>I am working/learning ASP.NET, C# and use my DBC and DBF for data containers.
>
>Yes, this is filter and the wright answer is:
>
>
>
>< % @Import Namespace = "System.Globalization" % >
>
>CultureInfo usCulture = new CultuireInfo("en-us")
>
>cmd.CommandText =
>string.Format(usCulture,"SELECT * from .... WHERE EventDate >=#{0:d}# and ... <= #{1:d}#)
>
>
>
>This way any data format is allways corect interpret as MM/dd/yyyy !.
>
>But, in fact my original Q., beside this main problem had another component ...
>
>How sholud I write above statement but not using String.Format(). Only SELECT ... and
>what is required ?
>
>Regards, Gojko

I don't understand why you don't want to use String.Format. It just makes writing it easier and less error prone. Anyway if you want to write w/o it:
cmd.CommandText =
 "SELECT * from .... WHERE EventDate >=#"+
 startDate.ToString("d", new CultureInfo("en-us"))+"# and ... <= #"+
 endDate.ToString("d", new CultureInfo("en-us"))+"#";
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform