Last post May 21, 2015 06:38 AM by Lokesh B R
May 21, 2015 06:12 AM|ManyTitles|LINK
Hi all, I am trying to get the number of rows affected by an Insert statement by returning (int)cmd.ExecuteNonquery in my dataaccess layer to the front-end in codebehind. The problem is I keep getting -1. I am relying on this value to determine if my insert
What am I doing wrong, although my data are inserted successfully, I keep getting -?. Thanks in advance for your help.
May 21, 2015 06:19 AM|Lokesh B R|LINK
Are you using stored procedure or inline query?
May 21, 2015 06:35 AM|ManyTitles|LINK
Hi Lokesh thanks for replying, I'm using a stored procedure.
May 21, 2015 06:38 AM|Lokesh B R|LINK
Edit the Stored Procedure and Change this line.
SET NOCOUNT ON; -> SET NOCOUNT OFF;