Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 24th, 2006, 10:18 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jun9nah
Default How to integrate search function n dropdown box

Hi,does anyone knows how to integrate the search function with a dropdown list on the aspx webpage?

Example....

The database consists of attributes or columns with headers such as
Names | IDs | Locations | Contact No .

The dropdown list is a search filter for various columns in the database such that when a user type something in the textbox, the dropdown list will filter what columns he want to search.


 
Old July 25th, 2006, 06:51 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You will have to use a dynamic query. For example if i place the text 'John Doe' in the textbox and the dropdown list has names selected you would build your query like this:

Dim strSQL as string = "SELECT " & dropdown1.selectedItem.Text &" From [table] WHERE " & dropdownlist1.selectedItem.text & " LIKE '%" & textbox1.text &"'"

The comand that will get sent to sql is: SELECT Names From [Table] Where Names Like '%John Doe'

Hth

"The one language all programmers understand is profanity."




Similar Threads
Thread Thread Starter Forum Replies Last Post
How to integrate search function n a dropdown box jun9nah VB.NET 0 July 24th, 2006 10:12 PM
Dropdown List search form [?] antonioluis Dreamweaver (all versions) 1 May 25th, 2005 01:10 AM
function for dropdown with 3 checkboxes gilgalbiblewheel Classic ASP Databases 0 August 18th, 2004 03:33 PM
Search using drop down list box and a text box tcasp Classic ASP Basics 1 July 31st, 2003 02:58 PM
Dropdown search?? jfoss Access 1 July 9th, 2003 07:24 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.