Ciri
Ciri

Reputation: 1

Relational database in Windows Phone 8

I am building an app where I have 2 tables in the schema. The first table contains a list of stores. Each line is one individual store with columns for address, phone, manager, etc.

The second table contains the inventory of each store. Each table contains the same columns (items, qty, price, ...) but of course the rows are different as each store has its own inventory.

I have both tables defined in my app under the same datacontext and I can populate them without a problem. My question is how to link them? I need a way to create a column in each row of the first table pointing to a different instance of the second table.

Upvotes: 0

Views: 217

Answers (1)

PmanAce
PmanAce

Reputation: 4303

You would create a primary key for the store id in the stores table. Then when you insert inventory in the second table, insert also the store id for each so you can link the information in both tables.

Upvotes: 1

Related Questions