Click here to Skip to main content
15,942,710 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What i want is to get identity column value from database on my web application page, and i have created a stored procedure and declare E_ID as output and also set it as scope_Identity(). my aim is when user inserts data other than E_ID (as E_ID is identity column and generates automatically), Automatically generated E_ID popup on webpage that say ur empid is< E_IdD that is generated>. for that my stored procedure is :
ALTER procedure [dbo].[spuserdetails]
@Name varchar(50),
@DOB datetime,
@Age int=null,
@Address1 varchar(70),
@phone int,
@Country varchar(50) = null,
@States Varchar(50) = null,
@City varchar(50) = null,
@E_ID int Out
  
 As 
Begin
insert into userdetails(Name,DOB,Addr,phn,Country,States,City )
values (@Name,@DOB , @Address1 , @phone , @Country, @States, @City )
set @E_ID=SCOPE_IDENTITY ()

end

how can i do what i want ?
Posted
Comments
ZurdoDev 28-Jun-13 10:04am    
I don't follow. What exactly are you trying to do? It appears that the title of your message and the the description don't quite match.
Mahesh Bailwal 28-Jun-13 10:13am    
Share your ASP.Net code from where you are making call to this SP.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900