Hi frdz,
I have created the following stored procedure in sql server 2005.
In my database i have one option for the payment mode which can be done thru cash or credit(cheque).
I have created my web-application in asp.net with C# 2005.
There i have a dropdownlist box for the user to select the option whether wants to do the payment thru cash or cheque.
Depending on that selection if user selects cheque then all the reqt for cheque like it's no,dt,bankname etc...are visible.
but if user selects the option as cash then the cheque details become invisible.
Depending on the selection of the user of the asp.net web-form how can i do changes in the stored procedure...
i can write the condition like
if paymentmode=cash
then ........
else
..........
but where and how can it be written ...pls tell me
thanxs in adv...u can go thru my below SP
ALTER PROCEDURE MiscellaneousStoredProcedure @.miscidint output, @.storenamevarchar(20),--store name to storeid @.accountnamevarchar(20), @.groupnamevarchar(20), @.paymentdtdatetime,@.payeenamevarchar(30),@.paymodevarchar(20),@.banknamevarchar(50), @.chqdtdatetime, @.chqnovarchar(20), @.amtnumeric(10, 2),@.balnumeric(10, 2), @.remarksvarchar(50)asdeclare@.storeidint,@.accountidint,@.groupidintbeginset nocount onselect @.miscid =isnull(max(@.miscid),0) + 1from miscellaneourpayifexists (select *from storemasterwhere storename = @.storename)select @.storeid = storeidfrom storemasterwhere storename = @.storenameifexists (select *from accountmasterwhere accountname =@.accountname)select @.accountid = accountidfrom accountmasterwhere accountname =@.accountnameifexists (select *from accountgroupmasterwhere groupname=@.groupname)select @.groupid=groupidfrom accountgroupmasterwhere groupname=@.groupnamebegin transactioninsert into miscellaneourpay(miscid,storeid,accountid,groupid,paymentdt,paymode,payeename,bankname,chqdt,chqno,amt,bal, remarks)values( @.miscid,@.storeid,@.accountid,@.groupid,@.paymentdt,@.paymode,@.payeename,@.bankname,@.chqdt,@.chqno,@.amt,@.bal,@.remarks)commit transaction endWhat about creating two different stored Proceedures for both cases?|||
Hi,
Try to use two different stroed procedure for cash and credit. The value from your DropDownList decides which one to use. In this way,you can make your stored procedure easier.
Thanks.
No comments:
Post a Comment