Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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 February 14th, 2005, 05:18 AM
Registered User
 
Join Date: Feb 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to pass parameters from a multiselect listbox

How can I pass parameters from a multiselect listbox to a SQL Stored Procedure?

 
Old February 14th, 2005, 10:43 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

multiselect listbox passes value as a comma separated list, for example

for e.g.
<select name="car" size="5" multiple id="car">
<option value="">--SELECT--</option>
<option value="1">Honda</option>
<option value="2">Toyota</option>
<option value="3">Nissan</option>
<option value="3">Mercedez</option>
</select>

If you select first two cars the value should be 1, 2

You have not provided any detail, whether you want to perform insert,update or delete in your stored procedure I am pointing to a link from Narayana Vyas. Hope this will help.

http://vyaskn.tripod.com/passing_arr...procedures.htm

 
Old February 14th, 2005, 03:19 PM
Registered User
 
Join Date: Feb 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What I am trying to do is just Select States from the list and also have a text box so a user can enter a last name the results will return certain fields from the table.

 
Old February 14th, 2005, 03:39 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

something like this..
CREATE PROC ProcGetResult
@StateList varchar(500),
@LastName varchar(50)
AS
BEGIN
     SELECT field1, field2, field3
     FROM MyTable
     WHERE State IN (@StateList) And LastName = @LastName
END
GO





Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiselect listbox selction and update table Suresh62 Access 58 January 2nd, 2008 08:39 AM
to pass parameters rashmid HTML Code Clinic 1 May 30th, 2005 11:10 PM
how to pass arrays as parameters ??? mrrgupta JSP Basics 2 October 23rd, 2004 06:50 PM
cannot pass parameters between forms deerebuck BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 3 February 15th, 2004 05:12 PM
How to pass multiple parameters to CR 9 syedjavid Crystal Reports 1 September 17th, 2003 05:50 AM





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