This question is locked. New answers and comments are not allowed.
Hi
I am using Telerik ORM to insert two objects. Object1 primaryKey(Guid or uniqueidentifie) is forigen key in Object2. When i save these objects, then Object2 is raising exception for conflict in PrimaryKey_ForiegnKey relationship. Primary key is provided at run time using Guid.
this is code
Error is
Insert of '1039162118-03b633b7-18c1-4450-9113-5617229eae1c' failed: Telerik.OpenAccess.RT.sql.SQLException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_TransferCharges_TransferWay1". The conflict occurred in database "DB", table "dbo.TransferWay", column 'TransferWayID'.
I am using Telerik ORM to insert two objects. Object1 primaryKey(Guid or uniqueidentifie) is forigen key in Object2. When i save these objects, then Object2 is raising exception for conflict in PrimaryKey_ForiegnKey relationship. Primary key is provided at run time using Guid.
this is code
| conn.StartTransaction(); |
| object value = conn.ExcuteNonQuery(transferWay); |
| if (transferCharge != null && value!=null) { |
| transferCharge.TransferWay = transferWay.TransferWayID; |
| value = conn.ExcuteNonQuery(transferCharge); |
| } |
| conn.EndTransaction(); |
Error is
Insert of '1039162118-03b633b7-18c1-4450-9113-5617229eae1c' failed: Telerik.OpenAccess.RT.sql.SQLException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_TransferCharges_TransferWay1". The conflict occurred in database "DB", table "dbo.TransferWay", column 'TransferWayID'.
How should i solve this problem?