XModPro

Error on call to Update Stored Procedure

Roberts Hunter Roberts Hunter asked May 21, 2013
Active May 21 · Viewed 3023 times
I am getting an error on my first stored procedure XMod Pro EditForm. The stored procedure is being called and it is updating correctly. However, the XMOD Form is giving me the error:<br />Error<br />MESSAGE:<br />An item with the same key has already been added.<br />STACK TRACE:<br />at KnowBetter.XModPro.FormFunctions.UpdateButtonClicked(XItem&amp; xi) at KnowBetter.XModPro.XModPro.frmAddRecord_UpdateButtonClicked(FormEventArgs fea)<br /><br />I can see in the database that all of the data has been updated and my stored procedure has returned the RetVal. I have have tried with both 0 and 1 as the return value and I get the same error.<br /><br />Here is the code for the stored procedure in XMP:<br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /><br />And here is the SP:<br />ALTER PROCEDURE [dbo].[LakeLoc_Location_Update_SP] <br />(<br />@LocationID int,<br />@LocationName varchar(100), <br />@LocationAddress1 varchar(100),<br />@LocationAddress2 varchar(100), <br />@LocationAddress3 varchar(100),<br />@LocationCity varchar(100),<br />@LocationState varchar(50),<br />@LocationZipCode varchar(10),<br />@LocationPhone varchar(25),<br />@LocationLongitude float,<br />@LocationLatitude float,<br />@LocationLogoUrl varchar(100),<br />@LocationHtmlAmen text,<br />@LocationHtmlFeature text<br />)<br /><br />AS<br /><br />BEGIN<br /><br />UPDATE [LakeLoc_Location] <br /> SET [LocationName]=@LocationName, <br /> [LocationAddress1]=@LocationAddress1, <br /> [LocationAddress2]=@LocationAddress2, <br /> [LocationAddress3]=@LocationAddress3, <br /> [LocationCity]=@LocationCity, <br /> [LocationState]=@LocationState, <br /> [LocationZipCode]=@LocationZipCode, <br /> [LocationPhone]=@LocationPhone, <br /> [LocationLongitude]=@LocationLongitude,<br /> [LocationLatitude]=@LocationLatitude, <br /> [LocationLogoUrl]=@LocationLogoUrl, <br /> [LocationHtmlAmen]=@LocationHtmlAmen, <br /> [LocationHtmlFeature]=@LocationHtmlFeature <br /> WHERE [LocationID]=@LocationID<br /><br />IF @@ROWCOUNT &gt; 0<br /> RETURN 0<br />ELSE <br /> RETURN 1<br /><br />END<br /><br />As stated above, I have tried to flip the return variable from 0 to 1 and both fail with the error above in XMP. The data is updated though in the database correctly.<br />

6 Answers

Loading answers...