Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Tue, 14 Feb 2006 11:16:29 -0800,    group: microsoft.public.dotnet.datatools        back       


Date filter on a DataGridView   
hello all
i'm using vb2005.
in one of the forms i'm using the filter method of the bindingsource 
i've used it before, but not on a date field.
now, any comparison i try produces an error (things like):
If tpToDate.Checked Then
            strFilter = "[chqCashDate]<=" & dtDate.Value            
ElseIf tpOnDate.Checked Then
            strFilter = "[chqCashDate]=" & dtDate.Value

in this example, dtDate is a datetimepicker, tpToDate is a radio button, and 
chqCashDate is a smalldatetime field in a sql db table

the error says something about invalid use of "=" operator.
can someone please guide me in the right way?

thanx in advance
Erez.
date: Tue, 14 Feb 2006 11:16:29 -0800   author:   Erez Mor

Re: Date filter on a DataGridView   
Hi,

You might take a look at DataColumn.Expression .net help topic on how to 
deal with date formats.

-- 
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"Erez Mor"  wrote in message 
news:9B725DCB-A138-4224-8269-7A02B31FAC1A@microsoft.com...
> hello all
> i'm using vb2005.
> in one of the forms i'm using the filter method of the bindingsource
> i've used it before, but not on a date field.
> now, any comparison i try produces an error (things like):
> If tpToDate.Checked Then
>            strFilter = "[chqCashDate]<=" & dtDate.Value
> ElseIf tpOnDate.Checked Then
>            strFilter = "[chqCashDate]=" & dtDate.Value
>
> in this example, dtDate is a datetimepicker, tpToDate is a radio button, 
> and
> chqCashDate is a smalldatetime field in a sql db table
>
> the error says something about invalid use of "=" operator.
> can someone please guide me in the right way?
>
> thanx in advance
> Erez.
date: Wed, 22 Feb 2006 13:55:07 +0100   author:   Miha Markic [MVP C#] miha at rthand com

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us