Update Stored Procedure throws Exception "Expects Parameter..."
-
My Table "Adressen" has as PrimaryKey "adid". When I want to update the Adressen Table occurs an error: Procedure sp_AdressenUpdate expects parameter @Original_adid which was not supplied. This error occurs only if I edit a row and update, NOT when I add new Rows and update then. The parameter @Original_adid exists. I hope you can help me! Thanks Stefan
-
My Table "Adressen" has as PrimaryKey "adid". When I want to update the Adressen Table occurs an error: Procedure sp_AdressenUpdate expects parameter @Original_adid which was not supplied. This error occurs only if I edit a row and update, NOT when I add new Rows and update then. The parameter @Original_adid exists. I hope you can help me! Thanks Stefan
STW wrote: This error occurs only if I edit a row and update, NOT when I add new Rows and update then. Because it's used only in the
DataAdapter.UpdateCommand
and, thus, must be added to theDataAdapter.UpdateCommand
'sParameters
property. The data adapter designer will do this for you if you opt for it. The exception would not be thrown if theParameters
property contained the parameter correctly - i.e., it's named "@Original_adid" and is declared as the correct type.Microsoft MVP, Visual C# My Articles