what was the erroe in my code?

Posted by Raghuldrag under C# on 7/11/2013 | Points: 10 | Views : 486 | Status : [Member] | Replies : 1
Hai Fireinds,

i ve the page like empdetails.apsx
in these i made 2 panels
I)empdeatils shows the details of

(username,age,department,employeecode) those thinks automatically shoe from database depends on the user Login.
travel purpose:textbox
total amount:textbox
if the person enter the text on purpose of travel request_id would be generated.
II)travel details show the information of,
departuredate:textbox,
from_place:textbox,
to_place:textbox,
mode :textbox,
add{button)
after given the add button entire details ll show on gridview table

here the problem is depends on the request_id panel-II
details ll be entered so i made the query like these............

MY procedure:
===============


alter procedure Insert_Journey
(
@departuredate datetime,
@from_location varchar(50),
@to_location varchar(50),
@metro nvarchar(50),
@trans_all nvarchar(50),
@mode_of_travel nvarchar(50),
@seat_type nvarchar(50),
@no_of_days int,
@other_details varchar(50),
@status_id int


)
as
BEGIN
DECLARE @MaxDate datetime,
@request int

SELECT @request = MAX(request_id) from travel_request a inner join users b on a.user_id=b.user_id
SELECT @MaxDate = MAX(DepartureDate) FROM onward_journey where request_id=@request


IF(@MaxDate > @departuredate)
begin

RAISERROR('Your error message for departuredate should be greater then maxdate',16,1)
RETURN
END

insert into onward_journey(departuredate,from_location,to_location,metro,trans_all,mode_of_travel,seat_type,no_of_days,other_details,status_id,request_id) values(@departuredate,@from_location,@to_location,@metro,@trans_all,@mode_of_travel,@seat_type,@no_of_days,@other_details,'2',@request)


end



when i choose the add panel-II details not inserted .......
what was error?




Responses

Posted by: lakhansin-22735 on: 7/13/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,

Can you please provide us the sample code, so that I can directly update on that code.
:-) That much be easier to us.

Thanks,

Lakhan Singh
Tech Lead
BeyondKey System Pvt. Ltd.
Indore, M.P.
India

Raghuldrag, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response