Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filter condition for datetime
Message
 
To
11/12/2003 14:45:23
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00858308
Message ID:
00858336
Views:
10
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform