This question is locked. New answers and comments are not allowed.
Hi,
I'm trying to build a kind of shop where I want to save my basket in the db.
I'm using the 'Best Practices in web development with OpenAccess' sample Link
My db setup is 2 tables. Basket and BasketItems where BasketItems have a FK to Basket
When i'm trying to commit the objects i gives me this error: #23000Column 'BasketID' cannot be null
My code:
What am i doing wrong?
I'm trying to build a kind of shop where I want to save my basket in the db.
I'm using the 'Best Practices in web development with OpenAccess' sample Link
My db setup is 2 tables. Basket and BasketItems where BasketItems have a FK to Basket
When i'm trying to commit the objects i gives me this error: #23000Column 'BasketID' cannot be null
|
My code:
Basket basket = new Basket(); |
basket.Basketid = '2a3edc4a-3108-430a-ac2a-5e027cf1d090'; |
basket.Customerid = 'dde49816-0223-4678-8ecd-e0f49f9610f0'; |
BasketItem item = new BasketItem(); |
item.Price = 12.5; |
item.Size = 5; |
item.Color = 'Blue' |
item.Quantity = 2; |
basket.Items.Add(item); |
objectScope.Add(basket); |
What am i doing wrong?