Thursday, March 22, 2012

ASP and SQL2000 drop-down menu

Okay, I am new to this so be gental.
I have a form with 2 drop down menus and a text field that I am concerned
with. Size, Packaging, and Cost. Size and Packaging pull their info from a
Size and a Packaging table respectively. 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 Cost the field:
declare @.size int, @.packaging varchar(50), @.cost money
set @.size=Size
set @.packaging=Packaging
Execute getmynumber @.size,@.packaging,@.cost OUT
select @.cost
I am sure I am doing this all wrong;
I am geting an error:
Invalid column name 'Size'
Is this not the way to reference a field on the web form (Size)?
And will this even work?Hi
Did you check out the links in your previous post?
John
"HollyylloH" wrote:

> Okay, I am new to this so be gental.
> I have a form with 2 drop down menus and a text field that I am concerned
> with. Size, Packaging, and Cost. Size and Packaging pull their info from a
> Size and a Packaging table respectively. 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 Cost the field:
> declare @.size int, @.packaging varchar(50), @.cost money
> set @.size=Size
> set @.packaging=Packaging
> Execute getmynumber @.size,@.packaging,@.cost OUT
> select @.cost
> I am sure I am doing this all wrong;
> I am geting an error:
> Invalid column name 'Size'
> Is this not the way to reference a field on the web form (Size)?
> And will this even work?
>|||Yes I did check them out. No I can't answer my question from them.
"John Bell" wrote:
> Hi
> Did you check out the links in your previous post?
> John
> "HollyylloH" wrote:
>

No comments:

Post a Comment