Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filter condition for datetime
Message
 
À
11/12/2003 14:45:23
Sergio Ortiz
Tek Services Group, Llc
Hollywood, Floride, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00858308
Message ID:
00858336
Vues:
11
You probably need to surround the datetime value in quotes:
DataRow[] drSelected = dsMyTableAllrecords.Tables[0].Select("red ='"+DateTime.Now+"'" );
otherwise your are passing an numerical operation (e.g. 2004/12/10 is treated as 2004 divided by 12 divided by 10)


>Hello all,
>
>I am trying to get an array of DataRows by setting a filter based on a DateTime condition. But I keep getting an error.
>
>Here is the code :
>
>
>DataRow[] drSelected = dsMyTableAllrecords.Tables[0].Select("red ="+DateTime.Now );
>
>
>Here is the error:
>
>Missing operand after '2' operator.
>
>
>Any idea??.
>
>Sergio
Hector Correa
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform