Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Ajax: Autocomplete, but from database!

Options
  • 08-07-2008 6:01pm
    #1
    Closed Accounts Posts: 317 ✭✭


    Hi,

    I'm using Visual Studio 2008.

    I would like to have an ajax enabled page where someone can type in a name into a text box and it autocompletes from a query from a sql database.

    I have seen a few examples on google but all of them have the building of the sql adapter and strings etc in the code which is not what I am looking for. And then it appears there is some Java looping occuring in a web service that is called.
    I have my sqladapter configured to just do a select on the name from the table in the database.

    Is there no easy way to do this !!!!!!!!!!! It seems very complicated alot of the ways I've seen.

    Thanks


Comments

  • Closed Accounts Posts: 167 ✭✭Deadeyes


    What do you mean by AJAX enabled auto-complete? Do you mean every time the user enters a letter in the input box the page goes back to the server to get possible matches? That to me sounds like a huge waste of trips and quite frankly I don't think the back and forth from the server is going to keep up the the users input.
    Alternatively you could load all the possible matches on page load and use client side Javascript to do the auto-complete. This would work out perfectly well provided there isn't a huge amounts of potential matches.


  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    Something like Google's Suggestions: http://www.google.com/webhp?complete=1&hl=en ?


  • Closed Accounts Posts: 317 ✭✭tiptap


    Webmonkey wrote: »
    Something like Google's Suggestions: http://www.google.com/webhp?complete=1&hl=en ?


    Yeah, something like that alright,

    I have it working now, I've set a count to 20 in the SQL statement and it's a small database so the round trips shouldn't make it too heavy.

    I ended up doing it with a webservice in the end, pretty nifty actually, although I thought it would have been quicker in the end with all the wizards and what not nowadays


Advertisement