HighTechTalks DotNet Forums  

Wildcard filter for numeric/date fields in dataset

Dotnet Data Tools microsoft.public.dotnet.datatools


Discuss Wildcard filter for numeric/date fields in dataset in the Dotnet Data Tools forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Suresh Gladstone
 
Posts: n/a

Default Wildcard filter for numeric/date fields in dataset - 11-14-2007 , 01:54 AM






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

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.