Database help

S

Steven

Hi everyone,

I have a slight confusion here, hope someone can shed some light on
this cubject for me.

calendar month - (tables - general, misc, notes).

I have a database with three tables, I have a month calendar view on my
form.
General, Misc and Notes will be on three different tabs.

For every selected date that I input data in the three different
tables, I am not understanding how to link the data to be displayed
back to the user.

Lets say I have information added for November 10, when I click on that
date, all the information pertaining to that date will populate the
listviews and various other fields that I have on the three seperate
tabs.

My dilemma is how to pull the data from the DB and populate the fields
from three different tables. Whats the easiest way to link the data?


Thanks
Steven

--
 
J

JTC^..^

Hi everyone,

I have a slight confusion here, hope someone can shed some light on
this cubject for me.

calendar month - (tables - general, misc, notes).

I have a database with three tables, I have a month calendar view on my
form.
General, Misc and Notes will be on three different tabs.

For every selected date that I input data in the three different
tables, I am not understanding how to link the data to be displayed
back to the user.

Lets say I have information added for November 10, when I click on that
date, all the information pertaining to that date will populate the
listviews and various other fields that I have on the three seperate
tabs.

My dilemma is how to pull the data from the DB and populate the fields
from three different tables.  Whats the easiest way to link the data?

Thanks
Steven

--



Create a Dataset containing the 3 Datatables (the same, or similar to,
the tables in you data store). Use DataAdapters to populate the
tables, with the data pertaining to the selected date only (You will
need to clear the table rows each time the date is changed).

Depending whether you are using WebForm, WPF or Classic WinForms set
the Bindings of the form and set the Datasource properties for the
list controls as appropriate.

Hope this helps?
 
S

Steven

Appreciate the response, I have been trying to figure this out but no
luck so far.

Instead of going with the various tables I decided to stick with just
one table, but the
information is going to be organized by the date. This is where I am
lost. I am sitting
here thinking about database programs that I have seen in stores, but I
just dont know
how they are linking up the information to the specific user.

Lets say for example I go into a store, they have my phone number as my
account.
Everything I buy is going to be stored under my number.

record item
123-456-7890 2 book set, wrappings, etc.

Then the next time I go to the store they add that info to my account.
Thats where I
am getting lost. Continue adding information to the account from
various tabs, and
pull all of the information back into the fields for that specific date
or ID, or whatever
I choose. Once I get past this confusion I think I will have it
figured out, but so far
I am totally lost.
 
J

JTC^..^

Appreciate the response, I have been trying to figure this out but no
luck so far.

Instead of going with the various tables I decided to stick with just
one table, but the
information is going to be organized by the date.  This is where I am
lost.  I am sitting
here thinking about database programs that I have seen in stores, but I
just dont know
how they are linking up the information to the specific user.

Lets say for example I go into a store, they have my phone number as my
account.
Everything I buy is going to be stored under my number.

record                          item
123-456-7890            2 book set, wrappings, etc.

Then the next time I go to the store they add that info to my account.
Thats where I
am getting lost.  Continue adding information to the account from
various tabs, and
pull all of the information back into the fields for that specific date
or ID, or whatever
I choose.  Once I get past this confusion I think I will have it
figured out, but so far
I am totally lost.

Research some SQL Basics, and in particular, "Primary keys" and
"Foreign keys". Further to investigate "Data Normalization" which is a
technique for designing database tables and relationships between
data.

In terms of your question, "ID" would be a Primary Key on a Customer
table and this "ID" would then be the Foreign Key on the
PurchasedItems table, to link the tables and subsequently the items
the customer has purchased. You'd have one record in the Customer
table per customer and many records in the PurchasedItems table
(otherwise known as a one-to-many relationship). Telephone Number or
Postcode would be data that is stored in the Customer table, that the
Store assistant has used to look up the Customer (incidently these are
generally bad choices as Primary Keys, certainly this case, more than
one customer could live at the same address).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top