473,221 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,221 software developers and data experts.

Filtering rows from DataTable

Hi All,
I've a DataTable with one column as PhoneNumber. The phone number is
stored as
(111) 222-3333. I need to filter the DataTable. the filter expression
could be 1112223333 or 2233 or 112. Any of these search critera should
filter the phone number

i need to perform filter like this
System.Data.DataRow[] objDataRows = objTable.Select("PhoneNumber like
'1112223333');
or
System.Data.DataRow[] objDataRows = objTable.Select("PhoneNumber like
'23333');
or
System.Data.DataRow[] objDataRows = objTable.Select("PhoneNumber like
'1122');

I need to format the PhoneNumber column. Like before searching i need
to convert phone number from (111) 222-3333 to 1112223333

Is there any way to format the column before searching ??? I expect a
statement like this
System.Data.DataRow[] objDataRows =
objTable.Select("Format(PhoneNumber) like '1122');

Please help me to sort out this problem.

Thanks in Advance
-ArunDhaJ
Jun 27 '08 #1
0 802

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

Similar topics

3
by: Alex Ayzin | last post by:
Hi, I have a problem that might be easy to solve(possibly, I've just overlooked an easy solution). Here we go: I have a dataset with 2 datatables in it. Now, I need to do the following: if...
5
by: TA | last post by:
Hi, Does anyone know if it is possible to filter rows in a DataTable by pattern (e.g. Like in SQL) For instance I want to select all rows containing the 'rob' in the name column. Any...
6
by: Ubi | last post by:
hi i have a problem with System.Data.DataViewRowState. i have a ReadOnly datagrid, a dataView and a dataTable. i'm using the dataView's filter property to filter the data (firstName =...
2
by: Darren Clark | last post by:
I have a data set... in which i need to remove 1 row based on a particaly name eg i have a data set (data) and it has 1 table and N rows.... It has a column name of i want to remove all...
1
by: Jason | last post by:
I've gathered a bunch of data from Active Directory and placed it into a datatable ("ADTable"). I now need to sort and filter this table based on the selection of a drop down list("ddlCategory"). ...
3
by: Craig G | last post by:
at the moment i have a dataset that returns data but i want to be able to filter the data so that there is only one occurence of each item (i.e. DISTINCT) the original dataset is populated by...
3
by: Shahriar | last post by:
I am using the following statement to filter a dataset. ds.Tables(0).DefaultView.RowFilter = "ID='" & currentpos & " ' It seems to run fine. My question is since I have a filter set, why is the...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
5
by: DBC User | last post by:
I have a data set which has a data table. This dataset is set as a datasource for a display grid. Before I assign the data set to data grid, I would like to elliminate some rows from the data...
2
by: kevinpond | last post by:
I have a Gridview displaying the results of a stored procedure. The stored procedure is constantly changing so the columns displayed in the data grid are constantly changing. I'd like to give...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...

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.