@user_id int,
@journey_place varchar(50),
@pickup_date datetime,
@return_date datetime,
@pickup_address varchar(250),
@return_address varchar(250),
@service_id int,
@vehicle_id int,
@mode_of_payment varchar(50)
AS
Begin
Declare @uid int
if(@uid = 0)
begin
set @uid = (select max(user_id) from registration)
end
Else
begin
set @uid = @user_id
end
insert into booking (user_id,journey_place,pickup_date,pickup_address,return_date,return_address,service_id,vehicle_id,mode_of_payment,status,starting_km,ending_km,booking_date)
values (@user_id,@journey_place,@pickup_date,@pickup_address,@return_date,@return_address,@service_id,@vehicle_id,@mode_of_payment,'true',0,0,getdate())
End
can any body tell me what should i pass argument in code to get userid..
cmd.Parameters.AddWithValue("@uid", ddluname.SelectedValue);
or
cmd.Parameters.AddWithValue("@user_id", ddluname.SelectedValue);
bt dis are not working.. and what should i pass argument in stored procedure.