Ken Sheridan
Active member
- Local time
- Today, 22:48
- Joined
- Jul 10, 2025
- Messages
- 158
Your ProductT does not have an ID of 0
To rectify the problem you need to add a record to the ProductT table with the Description of "Hourly Billing" with an ID of 7
Then you need to Update OrderdetailsT and change all of the 0 values to 7
Why not just insert a row into ProductT with a ProductID value of 0, and a Description value of 'Hourly Billing'? That way there's no need to update OrderDetailT, and the relationship can be enforced. The DefaultValue property of ProductID in OrderDetailT can be left as 0 or made Null as the OP considers most appropriate.
PS: I'd also recommend changing the name of the Description column to ProductDescription or similar. The former is a property name, and as such can be considered a reserved key word inappropriate for use as an object name.