|
-
May 14th, 2013, 10:20 PM
#4
Re: Saving Items From Datagridview to Database?
You would have one table for the receipt records and one table for the items on the receipts. There are numerous examples around like this, including the Order and OrderDetail tables in the Northwind and AdventureWorks example databases from Microsoft. For instance, you might have a Receipt table with a ReceiptID column as primary key. You might also have a ReceiptItem table with a ReceiptItemID column as primary key and a ReceiptID column as a foreign key from the Receipt table. If you save a Receipt record with a ReceiptID of 1 then you save all the items on that receipt to the ReceiptItem table with a ReceiptID of 1. You can then get all the items on a receipt by specifying the appropriate foreign key value to filter the data.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|