Reputation: 2158
I have a problem with a SQL Server stored procedure. Although I supply parameter, and although the parameter is not null, I got 'parameter is not supplied' error
My C# code is here:
staffInfo.DeleteCommand = "deleteStaff";
staffInfo.DeleteCommandType = SqlDataSourceCommandType.StoredProcedure;
staffInfo.DeleteParameters.Add("tcId", stafftc);
staffInfo.Delete();
Stored procedure:
ALTER PROCEDURE dbo.deleteStaff
(
@tcId varchar(11)
)
AS
BEGIN
DECLARE @memId int;
SELECT @memId = staffId FROM staff WHERE TCid = @tcId;
DELETE FROM member WHERE memId = @memId;
END
The delete operation is done perfectly. But I got this error anyway. What would be your suggestion?
Upvotes: 1
Views: 457
Reputation: 54628
If the delete operation is successful, the only way I can imagine this happening (especially since you haven't giving the details of the exception) is that there may be a trigger for delete that is calling another stored procedure that is failing.
Upvotes: 2