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
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:


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

Recommended Answers

All 4 Replies

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.

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,

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.

yes the id in tblUser is int and id of tblUser is forieng in academic table

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.