Results 1 to 2 of 2

Thread: Auto complete??

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2005
    Posts
    19

    Auto complete??

    I'm trying to work out the best way of going about the following project.

    Basically, I have a SQL Server DB. It has a table with a group of category headings in a field.
    I want to have a webpage with a search box on it and when the user types a word into it, I want to query the database and suggest possibilities to him or her.

    It should work in a similar (but much more simple) way to this:
    http://www.google.com/webhp?complete=1&hl=en

    or

    perhaps in a similar way to a web browsers URL bar when you type in a previously visited website.

    I reckon I've got to combine client and server side code to do this. I'm pretty sure it's gonna be heavy on the server as well.
    Has anyone got any good methods I could look into to get this done? I'm quite new to .NET having been a standard ASP man for a while.

    Thank you in advance for any help.
    Last edited by sist_si; Jan 14th, 2005 at 10:46 AM.

  2. #2
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668

    Re: Auto complete??

    use the Textbox's textchange trigger, when the user types something do an sql statement as such:

    sql = "select sitename from popularsites where sitename like '" + txtSearch.text +"*'

    then you need to populate the dropdown box with the results.
    If wishes were fishes we'd all cast nets.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width