Solved

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

Posted on 2010-08-18
6
1,224 Views
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.

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

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Auto Complete Test</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
       
     </asp:ScriptManager>

         <div>

             <asp:DropDownList ID="DropDownList1" runat="server">
             </asp:DropDownList>
             <asp:DynamicPopulateExtender ID="DropDownList1_DynamicPopulateExtender" 
                 runat="server" Enabled="True" PopulateTriggerControlID="" 
                 TargetControlID="DropDownList1"></asp:DynamicPopulateExtender>
            <asp:TextBox ID="Name" runat="server">
            </asp:TextBox><br><br>
               <asp:DropDownList ID="DropDownList2" runat="server">
             </asp:DropDownList>
             <asp:DynamicPopulateExtender ID="DropDownList2_DynamicPopulateExtender" 
                 runat="server" Enabled="True" PopulateTriggerControlID="" 
                 TargetControlID="DropDownList2"></asp:DynamicPopulateExtender>
            <asp:TextBox ID="TextBox1" runat="server">
            </asp:TextBox><br><br>
                <asp:DropDownList ID="DropDownList3" runat="server">
             </asp:DropDownList>
             <asp:DynamicPopulateExtender ID="DropDownList3_DynamicPopulateExtender" 
                 runat="server" Enabled="True" PopulateTriggerControlID="" 
                 TargetControlID="DropDownList3"></asp:DynamicPopulateExtender>
            <asp:TextBox ID="TextBox2" runat="server">
            </asp:TextBox><br><br>
            </div>
    </form>
</body>
</html>

Open in new window

0
Comment
Question by:Rosabella
  • 3
  • 3
6 Comments
 
LVL 5

Expert Comment

by:muhammadyasir
ID: 33472531
0
 
LVL 5

Expert Comment

by:muhammadyasir
ID: 33472553
0
 

Author Comment

by:Rosabella
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 vb.net if you can provide me with source code to a working sample that would be great.

sincerely,
Rosabella
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 5

Expert Comment

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

http://www.codeproject.com/KB/webforms/AjaxComboBoxControl.aspx
0
 

Accepted Solution

by:
Rosabella earned 0 total points
ID: 33477498
0
 

Author Comment

by:Rosabella
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.
0

Featured Post

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.

Question has a verified solution.

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

In this article I will describe the Backup & Restore 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.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

777 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