K
Kalman Skulski
I have a schema that has a parent child relationship. I have decided to
implelment operations using stored procs for the child table(view). I wrote
my custom insert update and delete and then mapped them to my view using the
configure behavior dialog.
At first I got an "An attempt was made to remove a relationship between a
Parent and a Child. ... OwnerParentId) cannot be set to null" when I
attempted to delete a child record. After a bit of research I changed my
schema association and added a DeleteOnNull. This made no change. I still
got the error. I then made by child FK field nullable. It won't ever be
null but OK.
This made the error disapear. Instead it just doesn't work.
I check the dbcontext log and found instead of calling my delete stored proc
it was calling my update stored proc.
I did try a manual delete by calling DeleteOnSubmit but when I delete it
using the UI (winform grid) it calls update instead of delete.
Any Ideas?
implelment operations using stored procs for the child table(view). I wrote
my custom insert update and delete and then mapped them to my view using the
configure behavior dialog.
At first I got an "An attempt was made to remove a relationship between a
Parent and a Child. ... OwnerParentId) cannot be set to null" when I
attempted to delete a child record. After a bit of research I changed my
schema association and added a DeleteOnNull. This made no change. I still
got the error. I then made by child FK field nullable. It won't ever be
null but OK.
This made the error disapear. Instead it just doesn't work.
I check the dbcontext log and found instead of calling my delete stored proc
it was calling my update stored proc.
I did try a manual delete by calling DeleteOnSubmit but when I delete it
using the UI (winform grid) it calls update instead of delete.
Any Ideas?