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, 13 Nov 2007 23:54:00 -0800,    group: microsoft.public.dotnet.datatools        back       


Wildcard filter for numeric/date fields in dataset   
Hi,
	I need to do a wild card search for all the fields in my table irrespective 
of whether its a numeric/date or string field . The data should filter only 
these data and show in the datagridview while I bound the datatable to it.
Lets say I have the following table

Name | DOB | SAL | Address

Jane |25/12/1976 | 25000 | Parkview boulevard
Hart |19/10/1988 | 16000 | Hunstville
Charles |15/12/1968 | 28000| Atlanta
Kate |25/12/1975 | 25000 | Parkview boulevard
Ron |25/12/1978 | 25000 | Parkview boulevard
Juane |25/12/1973 | 25000 | Parkview boulevard
Nick |25/12/1972 | 25000 | Parkview boulevard

Lets assume that this data is already there in my dataset with a data 
tablename "Employee"  and dataset name "dsEmployee"
While I give a search in this like 

dsEmployee.tables["Employee"].DefaultView.RowFilter = "name like '%25/12%' 
OR DOB like '%25/12%' OR SAL like '%25/12%' OR Address like '%25/12%'

I get an error "Cannot perform 'Like' operation on System.Date or 
System.Double . Is there a workaround on this. I want to do a wildcard search 
and filter a set of rows irrespective of the datatype of the datacolumn

Iam expecting an output of the following to be listed in the datagridview 
for the above output

Jane |25/12/1976 | 25000 | Parkview boulevard
Kate |25/12/1975 | 25000 | Parkview boulevard
Ron |25/12/1978 | 25000 | Parkview boulevard
Juane |25/12/1973 | 25000 | Parkview boulevard
Nick |25/12/1972 | 25000 | Parkview boulevard

Any help is very much appreciated
date: Tue, 13 Nov 2007 23:54:00 -0800   author:   Suresh Gladstone

Google
 
Web ureader.com


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