How to get @@Identity value using ADO.NET and ASP.NET

D

Dsquare

CREATE PROCEDURE sp_InsertMaterial

@MatEngName nvarchar(100),@MatJapName nvarchar(500),@Comments
nvarchar(500),@ImagePath nvarchar(100),@ImageStatus
nvarchar(50),@AddedDate datetime

AS

INSERT INTO
MaterialMaster(MaterialEngName,MaterialJapName,Comments,ImagePath,ImageStatus,AddedDate)

VALUES(@MatEngName,@MatJapName,@Comments,@ImagePath,@ImageStatus,@AddedDate)

SELECT @@IDENTITY as 'Identity'

This is my stored procedure to insert records in a particular table,
using Ado.net i want to retrieve this Identity number....

Can any body help..
 
C

Christopher Reed

Use an output parameter from your stored procedure and capture it as a
parameter in your code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top