开发者

The INSERT statement conflicted with the FOREIGN KEY constraint "FK_UserCars_aspnet_Users"

开发者 https://www.devze.com 2022-12-19 04:09 出处:网络
I am trying to insert data to UserCars table using ObjectDataSource Insert Method. the userId(FOREIGN KEY) I am trying to insert is GUID type.

I am trying to insert data to UserCars table using ObjectDataSource Insert Method. the userId(FOREIGN KEY) I am trying to insert is GUID type.

The primary key is UserId(uniq开发者_StackOverflow中文版eidentifier) in aspnet_users table which is part of Membrship schema.

userId(guid) = JustCreateduser so it means it should be the same values.


See if it really does exist:

SELECT * FROM aspnet_users WHERE UserIDGUID = @TheGuidBeingInserted

If you're having trouble getting info on what's actually happening, do a trace in SQL Profiler, capturing SQL statement completion, SP statement completion, RPC call completion, and RPC output parameter (just in case the GUID is coming back from a call).

That should give you some ideas to be able to proceed forward with solving the problem.


Have you confirmed that the guid does actually exist in the aspnet_users table prior to inserting it into the UserCars table?

0

精彩评论

暂无评论...
验证码 换一张
取 消