Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1498
  • Last Modified:

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

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
Rosabella
Asked:
Rosabella
  • 3
  • 3
1 Solution
 
muhammadyasirCommented:
0
 
muhammadyasirCommented:
0
 
RosabellaAuthor Commented:
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
Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
muhammadyasirCommented:
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
 
RosabellaAuthor Commented:
0
 
RosabellaAuthor Commented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now