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

  • Thread starter Thread starter Dsquare
  • Start date Start date
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..
 
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

Back
Top