6
Answers

Searching mobile number

Kamlesh Nikam

Kamlesh Nikam

14y
11.9k
1
hi,
i am developing one application in C# .net and i have some fields including mobil number and i want to search a mobile .
but i have store the mobile in sequence like (986)258-5896
and when ever i am trying to search mobile number 9862585896 it is not showing me a mobile number iot just give me blank. and when i am searching like 986 so it give me searching result

Thanks ...
Kamlesh
Answers (6)
0
Sam Hobbs

Sam Hobbs

NA 28.7k 1.3m 14y
It is obvious to me that the phone number should be stored unformatted; that is, just the numbers.
0
Suthish Nair

Suthish Nair

NA 31.7k 4.6m 14y

ill give an idea, might works...
select REPLACE(REPLACE(REPLACE(REPLACE('(998) 562-7255', '(', ''), ')', ''), '-', ''),' ','')
0
Kamlesh Nikam

Kamlesh Nikam

NA 25 77.2k 14y
Thanks but i have used
SearchQuery = SearchQuery + " and (MobileTelephoneNumber like '%" + txtContactSearch.Text.Trim() + "%')";

this quiry and i want to search by directly number (9985627255) and i store the number like (998) 562-7255
and while serching if i put 9985627255 it will not search..
so please help me

for searching the number

thanks
Kamlesh Nikam
0
Suthish Nair

Suthish Nair

NA 31.7k 4.6m 14y

If this query got resolved then please Accept the post that helped you as Answer.

So other members can easily find the answers.
0
Suthish Nair

Suthish Nair

NA 31.7k 4.6m 14y

Using SQL LIKE Operator
0
Sam Hobbs

Sam Hobbs

NA 28.7k 1.3m 14y
Okay; thank you for the information.