Given this schema:
Fruits
- FruitID INT PK
- FruitName NVARCHAR(30)
- FruitStatusID INT NULL FK: Statuses
Statuses
- StatusID INT PK
- StatusName NVARCHAR(30)
If I have a FruitID
in hand (just an int, not a Fruit object), how do I update the FruitName
and null out FruitStatusID
without loading the Fruit object from the database first?
Note: this solution gets me pretty far, but I can't figure out how to null out a FK column.
Answers in C# or VB, thanks!