473,587 Members | 2,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Like operator is not working with Dataview.RowFil ter

Hi, all

Could anny one give me help how can I use like operator with these data
types "integer , datetime or boolean" in DataView.RowFil ter

Actually when I try to get the data from dataview using rowfilter with
like operator
Its working fine when data type of searching column is "string" .

But if data type is "integer , datetime or boolean" its throws
error

This is the code which works fine

Dim dv As New DataView
dv = dttblFullData.D efaultView
dv.RowFilter = "first_name like 'lilly%'"
dgData.DataSour ce = dv

And this is not works fine

Dim dv As New DataView
dv = dttblFullData.D efaultView
dv.RowFilter = "Employee_i d like '4552%'"
dgData.DataSour ce = dv

or

Dim dv As New DataView
dv = dttblFullData.D efaultView
dv.RowFilter = "Birth_date like '08/12/2%'"
dgData.DataSour ce = dv
or

Dim dv As New DataView
dv = dttblFullData.D efaultView
dv.RowFilter = "is_Deleted like 1"
dgData.DataSour ce = dv
thanks

Jan 25 '07 #1
2 18902
"neeraj" <ne********@gma il.comschrieb
Hi, all

Could anny one give me help how can I use like operator with these
data types "integer , datetime or boolean" in DataView.RowFil ter

Actually when I try to get the data from dataview using rowfilter
with like operator
Its working fine when data type of searching column is "string" .

But if data type is "integer , datetime or boolean" its throws
error
Like does not work with Integer, Datetime or Boolean. Like means that a
string starts with the chars given. Integer, Datetime, Boolean are not
made of chars, thus it doesn't work. The filter string can contain the
Convert function, which might help. Have a look at the documentation of
DataColumn.Expr ession.
Armin

Jan 25 '07 #2
You can't. But you can write your own filters.

Instaed of "Employee_i d like '4552%'", "Employee_i d >= 45520
and Employee_id < 45530" (unless it's more than 5 digits, in which
I'd see if I could convert it a string and try the string compare).

Or instead of "Birth_date like '08/12/2%',
"Birth_Date >= '2000-Aug-12'"

Robin S.
---------------------------
"neeraj" <ne********@gma il.comwrote in message
news:11******** ************@v4 5g2000cwv.googl egroups.com...
Hi, all

Could anny one give me help how can I use like operator with these
data
types "integer , datetime or boolean" in DataView.RowFil ter

Actually when I try to get the data from dataview using rowfilter with
like operator
Its working fine when data type of searching column is "string" .

But if data type is "integer , datetime or boolean" its throws
error

This is the code which works fine

Dim dv As New DataView
dv = dttblFullData.D efaultView
dv.RowFilter = "first_name like 'lilly%'"
dgData.DataSour ce = dv

And this is not works fine

Dim dv As New DataView
dv = dttblFullData.D efaultView
dv.RowFilter = "Employee_i d like '4552%'"
dgData.DataSour ce = dv

or

Dim dv As New DataView
dv = dttblFullData.D efaultView
dv.RowFilter = "Birth_date like '08/12/2%'"
dgData.DataSour ce = dv
or

Dim dv As New DataView
dv = dttblFullData.D efaultView
dv.RowFilter = "is_Deleted like 1"
dgData.DataSour ce = dv
thanks

Jan 25 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
522
by: Jim Heimer | last post by:
When I use the dataview.rowfilter and I try to display the field value of the first row, the code doesn't seem to show the first row AFTER the rowfilter. This is my code: DataView DataView_Filter = new DataView(); DataView_Filter.Table = DS_States.Tables; sFilter = "Emplcode = '123233'"; DataView_Filter.RowFilter = sFilter; MessageBox.Show (DataView_Filter.Count.ToString()); //it displays 6
2
2292
by: Ryan Moore | last post by:
I have a dataset (called adset) which has a column called "Large" which is either an integer 0 or 1. I am creating 2 dataviews, one which should display the 1's and one which should display the 0's using the following code: DataView largeview = new DataView(); largeview.RowFilter = "Large=1"; largeview.Table = adSet1.Tables; DataView smallview = new DataView();
3
3005
by: Siegfried Heintze | last post by:
I'm displaying information on job postings in various cities. For example, might have a dozen jobs in Atlanta GA and I decide, at run time, that I don't want to see them. How do I set my DataView to filter them out? I tried but I don't understand the DataView.FilterState member function. Can someone give me an example that works with a Datagrid and data set instead of a console mode program? Thanks, Siegfried
2
8818
by: Anandan | last post by:
Hi, In our Project we use Dataset to load the Grid with Values. We have some criteria to filter the values to be shown in the Grid. For that we used the SELECT command to filter the Same Dataset. The SELECT Command we are using is as follows DS.Tables(0).Select("FieldName = '" & input value & "')
4
9241
by: Chris Botha | last post by:
Don't know if this can be done, but if I have a DataTable/DataView that has an integer column. Is there a way to do a "LIKE '123%'" kind of a filter on the column, which obviously works for text a text column. Thanks.
1
2703
by: AlexW | last post by:
Hi I am in the process of developing an inventory application in visual basic. I keep coming up against a problem with using the dataview.rowfilter property. Basically what happens is this: -a global dataview is created -The user enters new part information into a form. -A function is called to check to see if the part is a new part (so that two identical part numbers are not added to the database. -The check is done by setting the...
5
11824
by: AlexW | last post by:
Hi I am in the process of developing an inventory application in visual basic. I keep coming up against a problem with using the dataview.rowfilter property. Basically what happens is this: -a global dataview is created -The user enters new part information into a form. -A function is called to check to see if the part is a new part (so that two identical part numbers are not added to the database. -The check is done by setting the...
3
5384
by: =?Utf-8?B?cG1jZ3VpcmU=?= | last post by:
I have a dataset with 3 tables -- 2 Parent tables and 1 table that is a child table of both the parents. I create a dataview on the child table and set the rowfilter to a value which filters the child based on values in both parent tables. When I edit the parent tables the edit is not reflected in the dataview.count property. How can I force the dataview to refresh following parent table edits? For example: Parent1
3
3421
by: mortovski | last post by:
Hi, The Background I'm working on a Bible searching application, and I have a DataTable with a whole lot of verses in it that I'm wanting to search. So I'm using a DataView with a RowFilter to search through the text to return rows with a particular word. A sample of the code is as follows: public int SearchVerses(string searchtext) { searchtext = searchtext.Replace("'","\\'"); ArrayList verselist = new ArrayList();
0
7854
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8219
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.