Membership.ValidateUser Throws a SqlException

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
joebeazelman
Lieutenant (LT)
Lieutenant (LT)
Posts: 78
Joined: Wed Mar 05, 2008 11:27 am

Membership.ValidateUser Throws a SqlException

Post by joebeazelman » Tue Oct 11, 2011 3:08 pm

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.

plugables
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Sat Aug 15, 2009 4:04 am
Contact:

Re: Membership.ValidateUser Throws a SqlException

Post by plugables » Wed Oct 12, 2011 3:36 am

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.

Post Reply