Solved

Using a textbox to do a fuzzy lookup

Posted on 2006-11-13
6
512 Views
Last Modified: 2008-02-01
Hi there, the scenario of my problem is: A user can type in a string in a textbox, when he clicks the button the string must be used to do a fuzzy lookup with a reference table. If there is any similarities(where the _Similarity column > 0) between the string and a reference table it must show the fuzzyresults in a datagridview below the textbox.

Thanks.
0
Comment
Question by:cErasmus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 2

Expert Comment

by:amiableansari
ID: 17929209

take a datatable and fill it with something that you want to show in datagrid

mDT = new DataTable();
mAdapter.Fill(mDT);                  
dgTest.DataSource = mDT;

now when the user clicks on the button make a dataview and add a filter expression and assign it to the datagrid.

private void button1_Click(object sender, System.EventArgs e)
{
        DataView mView = mDT.DefaultView;
      mView.RowFilter = "ur_ref_fieldname like '" + textBox1.Text + "%'";
      dgTest.DataSource = mView;
}

0
 
LVL 14

Expert Comment

by:nayernaguib
ID: 17929435
I think you missed another wildcard character before the text.

     mView.RowFilter = "ur_ref_fieldname like %'" + textBox1.Text + "%'";

_______________

  Nayer Naguib
0
 
LVL 1

Author Comment

by:cErasmus
ID: 17929436
I tried this, but like is not going to work for me. You see I want to, lets say a guy wants to buy a product, but first he has to check his stock so he enters the product's name, lets say he wants to buy a "Brown glasshouse" so he enters it. Now I check in stock, and in my stock I have "Brown glasscasing". Is this possible? I would like to use something like this in a front-end program? Doing a fuzzy search outside of SSIS?
0
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 
LVL 4

Accepted Solution

by:
tobydavid earned 500 total points
ID: 17932015
You might find Levenshtein Distance useful.  This is a measure of (dis)similarity between two strings based on the number of changes it would take to turn the first string into the second.  Here is a good source of additional information

http://www.merriampark.com/ld.htm

It also contains the code you would need for either Java, C++, or Visual Basic
0
 
LVL 1

Author Comment

by:cErasmus
ID: 17954502
Thanks, but I already solved it, i'll still reward you.
0
 
LVL 4

Expert Comment

by:tobydavid
ID: 17955499
Thank you.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Six Sigma Control Plans
Introduction to Processes

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question