472,371 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Searching For Close Variations

Using .NET 2.0 (C#) I'm writing a small app that will have a "Person" class
that exposes FirstName and LastName properties. At runtime, a "People"
collection will be populated with a few thousand "Person" objects.

I want to provide users with the ability to search for people by FirstName
and/or LastName.

My question: How can I enable users to search for people with the last name
of [for example] "De Leon". I cannot assume that my users know how to
correctly spell it - so they may be searching with or without the space
(i.e., searching for either "Deleon" or "De Leon").

What are some reasonable/acceptable ways I can search the collection? I'm
wanting to address at least the specifics issue of [spaces within the name].

Thanks!
Jul 20 '06 #1
4 1316
Hey Jordan,

Is the data for people in a Sql Server database? If so, you could
store the value which the Sql Server soundex function returns. Then
you can base you query on searching for values with the same soundex.

HTH
Andy

Jordan S. wrote:
Using .NET 2.0 (C#) I'm writing a small app that will have a "Person" class
that exposes FirstName and LastName properties. At runtime, a "People"
collection will be populated with a few thousand "Person" objects.

I want to provide users with the ability to search for people by FirstName
and/or LastName.

My question: How can I enable users to search for people with the last name
of [for example] "De Leon". I cannot assume that my users know how to
correctly spell it - so they may be searching with or without the space
(i.e., searching for either "Deleon" or "De Leon").

What are some reasonable/acceptable ways I can search the collection? I'm
wanting to address at least the specifics issue of [spaces within the name].

Thanks!
Jul 20 '06 #2
RE:
<< Then you can base you query on ...>>

I'm not querying the db. Instead I want to search the collection of objects
in my app.

Thanks


"Andy" <aj*****@alum.rit.eduwrote in message
news:11*********************@p79g2000cwp.googlegro ups.com...
Hey Jordan,

Is the data for people in a Sql Server database? If so, you could
store the value which the Sql Server soundex function returns. Then
you can base you query on searching for values with the same soundex.

HTH
Andy

Jordan S. wrote:
>Using .NET 2.0 (C#) I'm writing a small app that will have a "Person"
class
that exposes FirstName and LastName properties. At runtime, a "People"
collection will be populated with a few thousand "Person" objects.

I want to provide users with the ability to search for people by
FirstName
and/or LastName.

My question: How can I enable users to search for people with the last
name
of [for example] "De Leon". I cannot assume that my users know how to
correctly spell it - so they may be searching with or without the space
(i.e., searching for either "Deleon" or "De Leon").

What are some reasonable/acceptable ways I can search the collection? I'm
wanting to address at least the specifics issue of [spaces within the
name].

Thanks!

Jul 20 '06 #3
Jordan,

You can implement a soundex function in your code easily. Here is a web
page that goes into it in some detail:

http://www.creativyst.com/Doc/Articl...1/SoundEx1.htm

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jordan S." <A@B.COMwrote in message
news:Oq**************@TK2MSFTNGP04.phx.gbl...
RE:
<< Then you can base you query on ...>>

I'm not querying the db. Instead I want to search the collection of
objects in my app.

Thanks


"Andy" <aj*****@alum.rit.eduwrote in message
news:11*********************@p79g2000cwp.googlegro ups.com...
>Hey Jordan,

Is the data for people in a Sql Server database? If so, you could
store the value which the Sql Server soundex function returns. Then
you can base you query on searching for values with the same soundex.

HTH
Andy

Jordan S. wrote:
>>Using .NET 2.0 (C#) I'm writing a small app that will have a "Person"
class
that exposes FirstName and LastName properties. At runtime, a "People"
collection will be populated with a few thousand "Person" objects.

I want to provide users with the ability to search for people by
FirstName
and/or LastName.

My question: How can I enable users to search for people with the last
name
of [for example] "De Leon". I cannot assume that my users know how to
correctly spell it - so they may be searching with or without the space
(i.e., searching for either "Deleon" or "De Leon").

What are some reasonable/acceptable ways I can search the collection?
I'm
wanting to address at least the specifics issue of [spaces within the
name].

Thanks!


Jul 20 '06 #4
Well, the principal would be the same. You'll need to locate something
like the soundex() function on Sql server and implement it in your
code. Then loop though the collection and match anyone that has a
similar soundex value.

Andy

Jordan S. wrote:
RE:
<< Then you can base you query on ...>>

I'm not querying the db. Instead I want to search the collection of objects
in my app.

Thanks
Jul 20 '06 #5

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

Similar topics

18
by: Roger Withnell | last post by:
I open a new window from the current window to display maps. Several maps of different sizes can be displayed. The function is given the size of the map and adjusts the window size accordingly....
4
by: Bill | last post by:
I need help closing a CMD window when it is executed from Access. 1) The batch file is called from Access. 2) Access closes, 3) the batch runs a copy of the access database (creating a backup)...
33
by: Geoff Jones | last post by:
Hiya I have a DataTable containing thousands of records. Each record has a primary key field called "ID" and another field called "PRODUCT" I want to retrieve the rows that satisy the following...
11
by: Michele and John | last post by:
I would like to write a C++ program that searches for the variable "state != 0" in a text file, and then go back 3 steps each time to read "count". The program should create a new file with "state ...
8
by: bevanward | last post by:
Hi all I have a large data set of points situated in 3d space. I have a simple primary key and an x, y and z value. What I would like is an efficient method for finding the group of points...
3
by: garrettm | last post by:
What if you want to search using FTS with AND logic using the FORMSOF(inflectional,...) inside the CONTAINS() clause??? if my search phrase is "light hearted" I can easily do an OR search using...
11
by: jonathan184 | last post by:
script to search for keywords in files in a dir Basically the script consists of a file with part numbers I got a dir with files I want to search the files line by line and if a line has the...
1
Corster
by: Corster | last post by:
I went through a great deal of hassle to figure this out for myself, but now it is complete, I would like to share it with the world! I know afew other people have had trouble with FindFirst and...
4
mfshake
by: mfshake | last post by:
I am try to make the user enter name and password then ask them if they want to search. The menu has the options and i am having trouble with the search method. Here's my server: import...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...

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.