Here's my SQL:
IF (SELECT Status FROM dbo.Coupon WHERE Guid = @pGuid) = 0
BEGIN
UPDATE
dbo.Coupon
SET
Status = @pStatus
WHERE
Guid = @pGuid
RETURN 0
END
ELSE
RETURN 1;
And here's my C#:
try
{
DbCommand command = db.GetStoredProcCommand("upd_Coupon_p");
db.AddInParameter(command, "@pGuid", DbType.String, s);
db.AddInParameter(command, "@pStatus", DbType.Byte, 1);
ds = db.ExecuteDataSet(command);
}
How can I get the return value of 0 or 1 inside of my code?