Solved

ASP.NET (VB) Auto Complete Combo box that populates dynamically from SQL, 2000+ entries

Posted on 2009-07-08
3
587 Views
Last Modified: 2012-05-07
Requirements:
- Autocomplete
- Populated from SQL query
- Over 2000 records, must not slow page load time
- Free (either provide code yourself or link to free component/code)
- VB
0
Comment
Question by:Cerixus
3 Comments
 
LVL 1

Expert Comment

by:SGUDAPAT
ID: 24807763
0
 
LVL 3

Expert Comment

by:Kelevra
ID: 24808303
Hi,
the best way to accomplish this, in my point of view is to use the jQuery's autocomplete:
http://www.pengoworks.com/workshop/jquery/autocomplete.htm

wich takes its data from a xml file.

so you make your Db query create your XML file upon it.

then get this autocomplete linked to this freshly made xml.

Done.
$(function() {

    $.ajax({

        type: "GET",

        url: "dbug.xml",

        dataType: "xml",

        success: function(xml) {
 

            /* Count elements */
 

            var count = jXML.getCount(xml,{"Channel":"channel","Item":"item:has(title)","GUID":"guid[isPermaLink]:lt(3)"});

            alert( count["Channel"] + ", " + count["Item"] + ", " + count["GUID"] );
 

            /* Return objects with a specific attribute */
 

            var attribute = jXML.getAttribute(xml,{"GUID":["guid","isPermaLink",null],"Channel":["channel","id",null]});

            alert( attribute["GUID"] + ", " + attribute["Channel"] );
 

            /* Return objects with a specific attribute value */
 

            var attribute = jXML.getAttribute(xml,{"GUID":["guid","isPermaLink","false"],"Channel":["channel","id","channel_1"]});

            alert( attribute["GUID"] + ", " + attribute["Channel"] );
 

            /* Return a number of objects randomized */
 

            var random = jXML.getRandomObj(xml,{"Title":["item:has(title) > title",null],"URL":["item:has(link) > link",3]});

            for (i = 0; i < random["Title"].length; i++) {

                alert( $(random["Title"][i]).text() );

            }

            for (i = 0; i < random["URL"].length; i++) {

                alert( $(random["URL"][i]).text() );

            }
 

        }

    });

});

Open in new window

0
 
LVL 1

Accepted Solution

by:
Cerixus earned 0 total points
ID: 24918767
Ended up using the Ajax autocomplete extender with a web service as seen in this video: http://www.asp.net/learn/AJAX-videos/video-122.aspx
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now