473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

ASP, SQL server DB,Drop Down List

2
Hi,
I'm creating a website for an hotel and i need to know how to collect data from a drop down list then search in the database and display it in another page. the design is like this:

DropDownList1// view
DropDownList 2// capacity
DropDownList 3//price

RadioGroup //type of data sort (Rooms are sorted by price or by room number)

Button1


what I want to do is when I click the button, I collect all the data that the user chose in all the controls (DropDownList1,DropDownList 2,DropDownList 3,RadioGroup) and start to search with them in the database, for example if the user chose the sea view and the capacity 2 persons and the price between 10$ and 20$ sorted by price, I will display all the rooms with a sea view and capacity 2 persons and a price between 10$ and 20$, sorted by price.

please help,
Thanks :)
Jun 15 '07 #1
1 1556
jhardman
3,406 Expert 2GB
hey, nina, welcome to the scripts developer network.

how much do you have done so far? is your form and db already set up? Can you already connect to a db through asp? do you know how to write a db query?

If you are just wondering about how to write the query, I would try something like this:
Expand|Select|Wrap|Line Numbers
  1. query = "SELECT * FROM rooms WHERE view LIKE %"
  2. query = query & request("view") & "%"
  3. query = query & " AND capacity = " & request("capacity")
  4. query = query & " AND price BETWEEN " & request("price")
  5. query = query & " ORDER BY " & request("sort")
  6.  
  7. 'print out query just to make sure it looks right
  8. response.write "<!-- " & query & " -->" & vbNewLine
  9.  
  10. rs.open query, conn
  11.  
  12. do until rs.eof
  13.    'list each room and details
  14.    'etc however you like
  15.    rs.movenext
  16. loop
let me know if this helps

Jared
Jun 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Dan | last post by:
This is one that has me stumped and I need an expert's input. Any ideas why the values from the second script-generated drop down list isn't recognized by the script to add time values to the...
1
by: Dec | last post by:
Ok to simplify things I'll just give an example. This is pretty much what I want to do (minus the postcode): http://www.perrys.co.uk/usedcar?ID=F5J9BNNBMVK00DF I have relatively little...
3
by: Miguel Dias Moura | last post by:
Hello, i have an ASP.NET / VB page where i have a few 4 groups of Drop Down Lists. Each group of Drop Down Lists include 3 Drop Down Lists for date such as: DAY, MONTH, and YEAR. I don't want...
2
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will...
8
by: Ed Dror | last post by:
Hi there ASP.NET 2.0 VB & SQL Express Lest take Northwind Categories Products as example I create a table that hold these two together and I create a stored procedure like select ProductID,...
5
by: ashok893 | last post by:
I'm using two drop down list ina form. I have generated the first drop down list from MySQL database. When i select an option from first drop down list, i have to generate second drop down list...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
3
by: penny111 | last post by:
Hi there, For my application, i need to have 3 drop down lists 1. drop down list of folder names 2. drop down list of documents in the folder selected 3. drop down list of instances of the...
8
by: dskanth | last post by:
I have 4 drop down lists, namely Location, country, State and City. Ex: Location: Asia, Country: India, State: Andhra Pradesh, City: Hyderabad. If i select any option in the Location drop down...
0
by: sandeepsangshetty | last post by:
How do I create a drop down list which has the values from a database column. So I need this list to have values like" "Select distinct departmentname from Department" The Department name...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.