ASP SQL and drop-down menus updated by user selection

H

HollyylloH

I have a form with 3 drop down menus that I am concerned
with: Size, Packaging, and Cost.

In a nut shell, I need to have the values in the Size and Packaging fields
passed in a query to a sql table and return a Cost value.

Details:

Size and Packaging pull their info from a Size and a Packaging table
respectively, on a SQL2000 server.

I need the third field, "Cost", to take the values selected by the user in
the Size and Packaging fields, and use those values to query a third table
"Cost." The Cost Table has three fields: Size, Packaging, and Cost (The cost
field is always different
depending on the Size and Packaging chosen).

I have created a server side procedure:

Create Procedure getmycost
@size int,
@packaging varchar(50),
@cost money OUT
AS
Select @cost=Cost
From Cost
Where
Size = @size AND
Packaging = @packaging

I have placed the this code on the client side within the "Cost" field using
the Data Results Wizard:

declare @size int, @packaging varchar(50), @cost money
set @size=::Size::
set @packaging=::packaging::

Execute getmynumber @size,@packaging,@cost OUT
select @cost

It does not appear to be doing anything.

What I think what I need now is a way to have the "Cost" field update after
the "Size" and the "Packaging" fields have been updated by the user.

Right now nothing is in the Cost field and nothing is passed to the server
when I hit the Submit button.

Hope someone can help!
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top