Application and Database

daveofgv

Well-known member
Joined
Sep 17, 2008
Messages
218
Location
Dallas, TX
Programming Experience
1-3
I have a application that I have been workig on. I figure (after 2 years) it's time to get it done. :)

My applicatoin will have a database connected to it, however, that is not my problem.

Issue:

When I create the application what is the best way to have the database and windows forms so when there is a person added (say John Doe) and he has multiple entries say (red car, blue car and green car) I am not sure how to make it where I can add a bunch of entries.

I started to create the database with one table, however, If I add information to one person I am not sure how to match it up with that person. I do understand primary keys, but not sure how to match it up with a windows form.

I suppose this is more a database quesiton, however, it's in my windows form application.

Any help would be appreciated.

daveofgv
 
Your database would multiple tables with the child table containing a foreign key from the parent table, e.g. your Person table has a PersonID column as its primary key and your Car table has a PersonID column that is a foreign key related to the PK of the Person table. That relationship is then mapped to a DataSet or whatever in your application. Exactly how you work with the data in your application depends on exactly what you want to achieve. Here's one example of how you might display related data:

Master/Detail (Parent/Child) Data-binding
 
Since my application isn't huge - what are the concerns for having everything in one table. Seems to be easier instead of creating relationships.

What are the upsides and downfalls?
 
Back
Top