0

Basically I want to develop a Address lookup(part of my project) using C# (and I can use SQL if necessary). I have a very large text file which have all the UK address and postcodes. Addresses needs to be looked up from this text file.

For example, as soon as a user type in the first letter of the postcode it should list all the postcodes starting with that letter and as they type in further, the list should narrow down.

Could you guys please how I can do this search very fast and list the results in a efficient way. If you guys know any methods and technologies pls do advice.

3
  • I havent personally done this, but it looks like a trie is needed here, or something similar.
    – Karthik T
    Nov 28, 2012 at 2:51
  • You should probably start by parsing the text file into a SQL database.
    – HellaMad
    Nov 28, 2012 at 4:21
  • 1
    The term you're looking for is Autocomplete. Nov 28, 2012 at 7:34

1 Answer 1

-1

For performance issues the first thing to do would be, importing the text files into a database.

On typing you can query the affected fields with "where Field LIKE 'input%' Order by xxx" and display the result.

Depending on the amount of Data you also could load all data to your local machine and apply filters on the displayed data.

1
  • Hitting the database on every keystroke is a poor idea. Its better to just load the data into memory for client side filtering, in my experience.
    – RubberDuck
    May 30, 2016 at 0:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.