krishna bharath

krishna bharath

  • NA
  • 12
  • 3.6k

Stored procedure is returning -1

Sep 19 2014 2:20 AM
Hello friends,
   I am developing an application in MVC 4.0 using entity framework. When i insert a row in the database table, the value is inserted successfully. I am using scope_identity() to get the Identity value of the newly inserted column. When i execute the  stored procedure, it is showing the Scope_identity() value correctly. But when I am trying to insert the value through front-end code using stored procedure, it is returning -1. Though the data is inserted successfully, it is returning -1. Please help me in solving this issue. I need to get the ID. 

Answers (4)