Hi!
I'm hoping someone can help me come up with a 'best possible solution'
for the following problem:
I'm trying to design an addressbook, i.e a storage for adresses. I
would like my adresses to have a random number of fields, all of which
are strings. Futhermore every address can belong to zero or more
categories (ie. friend, family etc.)
Now, I've designed some tables in a relational database to store these
data:
create table addressId (
id counter primary key
);
create table addresses(
id int,
fieldname string,
fieldvalue string);
alter table addresses add constraint foregin key (id) references
addressId(id);
--- so an adress is really a list of fields.
create table kategories(
id counter primary key,
name string
);
create table adrkat(
adr_id int,
kat_id int
);
I think you get the idea, right? An address is a list of fields, and
an address has a many-to-many relationsship with some categories.
Anyway, the question: How can I best organize my adresses in csharp,
using DataSets, DataAdapters and whatnot?
First I thought of letting an address be a hashtable, but then again I
could also incapsulate a dataset containing one or all of the above
tables in an an address object.
So I guess the question is:
- How do I incapsulate several tables in one dataset. Is that the way
to do it?
- How do I manage insertions/deletions - is that ready 'out of the
box' with datasets?
Phuu..maybe a too complex question, but I'm hoping you can give me
some ideas or point me to something simillar made before?
Regards,
Bjarne