-
6
Answers
-
Last Activity:
long time ago,
Kelly Ford
Your question has been submitted and is awaiting moderation.
Thank you for reporting this content, moderators have been notified of your submission.
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:
Error
MESSAGE:
An item with the same key has already been added.
STACK TRACE:
at KnowBetter.XModPro.FormFunctions.UpdateButtonClicked(XItem& xi) at KnowBetter.XModPro.XModPro.frmAddRecord_UpdateButtonClicked(FormEventArgs fea)
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.
Here is the code for the stored procedure in XMP:
And here is the SP:
ALTER PROCEDURE [dbo].[LakeLoc_Location_Update_SP]
(
@LocationID int,
@LocationName varchar(100),
@LocationAddress1 varchar(100),
@LocationAddress2 varchar(100),
@LocationAddress3 varchar(100),
@LocationCity varchar(100),
@LocationState varchar(50),
@LocationZipCode varchar(10),
@LocationPhone varchar(25),
@LocationLongitude float,
@LocationLatitude float,
@LocationLogoUrl varchar(100),
@LocationHtmlAmen text,
@LocationHtmlFeature text
)
AS
BEGIN
UPDATE [LakeLoc_Location]
SET [LocationName]=@LocationName,
[LocationAddress1]=@LocationAddress1,
[LocationAddress2]=@LocationAddress2,
[LocationAddress3]=@LocationAddress3,
[LocationCity]=@LocationCity,
[LocationState]=@LocationState,
[LocationZipCode]=@LocationZipCode,
[LocationPhone]=@LocationPhone,
[LocationLongitude]=@LocationLongitude,
[LocationLatitude]=@LocationLatitude,
[LocationLogoUrl]=@LocationLogoUrl,
[LocationHtmlAmen]=@LocationHtmlAmen,
[LocationHtmlFeature]=@LocationHtmlFeature
WHERE [LocationID]=@LocationID
IF @@ROWCOUNT > 0
RETURN 0
ELSE
RETURN 1
END
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.