473,396 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

dataset and more complex relational data

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
Nov 16 '05 #1
1 1410
RFS
Hi bjarne,
The answer depends on how you store the data. If the Data is store in a db
of in a XML. I would use a dataset or the like to link to the datastore I
would then create a class for every "noun" in your specification. That is
one for every address one for every person and so on. It's much easier to do
stuff with your records that way, and if you tie up the properties to the
dataset (or what ever u used) updating the datastore would be really easy.
If you take a look at dk.edb.programmering.dotnet under the thread smart...?
you can see a similiar discussion (it's in danish so only useful if you
understand my mother tongue)
"stormogulen" <sk********@yahoo.dk> skrev i en meddelelse
news:27**************************@posting.google.c om...
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

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bill C. | last post by:
Hi, I've got a simple console app that just reads an XML file into a DataSet then prints out a description of each table in the DataSet, including column names and row values for each column. ...
0
by: Frosty | last post by:
Hi I am using the VS xsd designer to create a strongly typed dataset. The dataset is apparently successfully created, with no warnings or errors given. Is it not then to be expected that this...
4
by: geilen | last post by:
I'm trying to use a dataset returned from a web service in an unmanaged C++ (MFC) client. The dataset is returned as a BSTR, and I'm having trouble reading the BSTR into an XML document for...
4
by: Oscar Thornell | last post by:
Hi, I have a relativley large/complex typed dataset that contains 7-8 tables and some supporting relational tables (lookups) for many-to-many relations. A good exampel would be a dataset that...
1
by: J. Askey | last post by:
I am implementing a web service and thought it may be a good idea to return a more complex class (which I have called 'ServiceResponse') in order to wrap the original return value along with two...
8
by: darrel | last post by:
I've decided that instead of doing an XSLT transformation on a file, I might be better off bringing it in as a dataset and having a bit more direct control over it at that point. The question I...
7
by: =?Utf-8?B?ZG91Zw==?= | last post by:
Have loaded balanced web servers that we do not allow to connect to our database. Content is created and pushed to these sites. I want to add a web service that may get multiple requests a second...
7
by: Fred Chateau | last post by:
If I have a dataset in memory, can I save that dataset to a SQL database without having a schema or manually creating the tables? -- Regards, Fred Chateau http://hotelmotelnow.com
3
by: Fred Chateau | last post by:
Still working on my XML DataSet... Having moved on past difficult and complex problems, resolved with the assistance of everyone here, I find myself facing yet another problem. My XML document...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.