Page 1 of 1

Membership.ValidateUser Throws a SqlException

Posted: Tue Oct 11, 2011 3:08 pm
by joebeazelman
I'm writing a some custom code for AbleCommerce, when I call the following from my code:

if (!Membership.ValidateUser(user, pass))
throw new SecurityTokenException("The user does not exist or was not validated with the given password.");

The following exception is thrown:
The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Stores_ac_AuditEvents_FK1". The conflict occurred in database "f3256_ablecommerce", table "dbo.ac_Stores", column 'StoreId'.
The statement has been terminated.

Obviously, it some context isn't being set. Any ideas? Thanks.

Re: Membership.ValidateUser Throws a SqlException

Posted: Wed Oct 12, 2011 3:36 am
by plugables
Are you using the custom code inside AbleCommerce? If no then thats what causing the problem. AbleCommerce needs a context token that is initialized and it also takes into account the store license.