0

i have two table in db:
table1: id(pk) int,firstname varchar(20),lastname varchar(20),username varchar(30),passwrod varchar(15)

table2:fscmarks int,metricmarks int,id(fk) int

stored procedure for table2:

create proc academic
(
@fscmarks int,
@metricmarks int
as
begin
declare @id int
select @id=CURRENT_IDENT('table1');
insert into table2 values(@fscmarks,@metricmarks,@id);
)

and behind login click is set session variable like this:

Session["id"]=txtemail.Text;
Response.Redirect("academic.aspx");

and on academic.aspx.cs i pass this:

SqlParameter id = new SqlParameter("id", Session["id"].ToString());

but it not working and catch the error, now suggest me what i do???
Thanks in Advance

Edited by pritaeas: Added code tags.

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by muhammad.waleed.9699
0

I suggest you provide the error itself.

Also run a debug on the academic.aspx page and check what the session value contains when it loads.

0

actualy if note that in acedamic store procedure i store the id,,, but i dont know when user is login how i get that user id for that table,

0

Is the user ID in the table different from the ID you store in the session (their email by the look of it).
As Mikey mentioned, if you are getting an error posting that up will help.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.