How can I make a dropdown list with autocomplete in VB.NET and SQL?

Posted on 2010-08-18
Last Modified: 2012-06-21
I have a web application with 3 drop down lists that are populated from a SQL database. Each drop down displays over 5,000 results. How can I make a drop down list with autocomplete in VB.NET and SQL.  

If the person types SN then about 10 results would display like snail,snakes, snorkel. The based on the selection another textbox is populated with a numeric ID number.

So if I selected snake in one drop down field the other text field next to it would display '000450'

I have limited .NET experience and would appreciate a code sample if possible.  I was trying to use the ajax autocomplete but their website is not .NET newbie friendly.

<%@ Page Language="VB" AutoEventWireup="false" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" >
<head id="Head1" runat="server">
    <title>Auto Complete Test</title>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">


             <asp:DropDownList ID="DropDownList1" runat="server">
             <asp:DynamicPopulateExtender ID="DropDownList1_DynamicPopulateExtender" 
                 runat="server" Enabled="True" PopulateTriggerControlID="" 
            <asp:TextBox ID="Name" runat="server">
               <asp:DropDownList ID="DropDownList2" runat="server">
             <asp:DynamicPopulateExtender ID="DropDownList2_DynamicPopulateExtender" 
                 runat="server" Enabled="True" PopulateTriggerControlID="" 
            <asp:TextBox ID="TextBox1" runat="server">
                <asp:DropDownList ID="DropDownList3" runat="server">
             <asp:DynamicPopulateExtender ID="DropDownList3_DynamicPopulateExtender" 
                 runat="server" Enabled="True" PopulateTriggerControlID="" 
            <asp:TextBox ID="TextBox2" runat="server">

Open in new window

Question by:Rosabella
  • 3
  • 3

Expert Comment

ID: 33472531

Expert Comment

ID: 33472553

Author Comment

ID: 33476881
Hi Muhammadyasir,

I have seen those but they do not provide source code regarding the population of the combobox from a db. I have tried using that snippet, it also requires a webservice which I am unfamiliar with. I am a newbie to if you can provide me with source code to a working sample that would be great.

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.


Expert Comment

ID: 33477354
just go through this page it is being used in c# and Javascript. it is great one.

Accepted Solution

Rosabella earned 0 total points
ID: 33477498

Author Comment

ID: 33477539
The suggestions offered by the only member who answered my question I already had reviewed previously.  I was looking for more than just regurgitation from a website, as a newbie I was looking for a code sample in VB.NET not C# and found it.

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

911 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

22 Experts available now in Live!

Get 1:1 Help Now