473,385 Members | 1,838 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,385 software developers and data experts.

Datasets - use 1 or many?

I'm learning when it comes to Datasets. Should I just have a single dataset
to handle my entire application data or should I use multiple - a dataset
for each function or form within my application? Is the data actually
written from and queried to the dataset only when needed per a table
adapter? It looks like the table adapters .fill method is only invoked when
required, so I assume a single dataset would suffice. Is this right?

Thanks,
Ryan
Jun 14 '06 #1
9 1733
The Fill method is only invoked when you invoke it - so it is up to you to
only do it at the right times.

There is no one right answer, but given very few details as to the nature of
your app, I would say a safe thing to do is to have 1 for each form. Once a
form is closed, you don't want something in your application holding on to
that data or still keeping it around. Each form should be able to deal with
its own data, and shouldn't need to know about data that belongs to other
forms.

"Ryan" <Ty****@newsgroups.nospam> wrote in message
news:eT****************@TK2MSFTNGP02.phx.gbl...
I'm learning when it comes to Datasets. Should I just have a single
dataset to handle my entire application data or should I use multiple - a
dataset for each function or form within my application? Is the data
actually written from and queried to the dataset only when needed per a
table adapter? It looks like the table adapters .fill method is only
invoked when required, so I assume a single dataset would suffice. Is
this right?

Thanks,
Ryan

Jun 14 '06 #2
Thanks. This is actually the way I started setting up my project (one
dataset per form). Since each form should need access to at most 4-5 tables
and I didn't want to include all 20+ tables in a single dataset.

Ryan

"Marina Levit [MVP]" <so*****@nospam.com> wrote in message
news:%2*****************@TK2MSFTNGP05.phx.gbl...
The Fill method is only invoked when you invoke it - so it is up to you to
only do it at the right times.

There is no one right answer, but given very few details as to the nature
of your app, I would say a safe thing to do is to have 1 for each form.
Once a form is closed, you don't want something in your application
holding on to that data or still keeping it around. Each form should be
able to deal with its own data, and shouldn't need to know about data that
belongs to other forms.

"Ryan" <Ty****@newsgroups.nospam> wrote in message
news:eT****************@TK2MSFTNGP02.phx.gbl...
I'm learning when it comes to Datasets. Should I just have a single
dataset to handle my entire application data or should I use multiple - a
dataset for each function or form within my application? Is the data
actually written from and queried to the dataset only when needed per a
table adapter? It looks like the table adapters .fill method is only
invoked when required, so I assume a single dataset would suffice. Is
this right?

Thanks,
Ryan


Jun 14 '06 #3
Hi Ryan,

In addition, I suggest you put all relational tables in a DataSet. There is
no requirement for using how many DataSets on a form. It's just for your
convenience, which makes the developer clear of relations between tables.
HTH.

Kevin Yu
Microsoft Online Community Support

================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jun 15 '06 #4
Ryan,

One single dataset will probably be very inefficient. Where you cut it is up
to you. Version 2005 goes back to the datatable (the equivalent of the
recordset) approach. Although that is for external reasons always wrapped
inside a dataset.

I hope this gives an idea, do you want to know more specific things, than
reply

Cor

"Ryan" <Ty****@newsgroups.nospam> schreef in bericht
news:eT****************@TK2MSFTNGP02.phx.gbl...
I'm learning when it comes to Datasets. Should I just have a single
dataset to handle my entire application data or should I use multiple - a
dataset for each function or form within my application? Is the data
actually written from and queried to the dataset only when needed per a
table adapter? It looks like the table adapters .fill method is only
invoked when required, so I assume a single dataset would suffice. Is
this right?

Thanks,
Ryan

Jun 15 '06 #5
Kevin and Marina,

I had not seen that you both had answered already while replying.

Probably something in my eyes.

:-)

Others I had written "in addition".

So by this.

Cor

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> schreef in bericht
news:%2***************@TK2MSFTNGXA01.phx.gbl...
Hi Ryan,

In addition, I suggest you put all relational tables in a DataSet. There
is
no requirement for using how many DataSets on a form. It's just for your
convenience, which makes the developer clear of relations between tables.
HTH.

Kevin Yu
Microsoft Online Community Support

================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jun 15 '06 #6
Just to give you all an example of one of my forms and an idea of what type
of dataset I need:

I have an application form which displays an application sent in by a person
(applying for a position on a public board). The form needs to display
information from all of the following relational tables:

The Person table containing contact information for that person.
The Application table containing general information about the application
(when and how it was submitted)
The Application_mm_Board table which contains a record for each board this
application is being submitted for.
The Board table which is needed for the name of each board the applicant is
applying for.
The Application_mm_Question table which contains a record for each question
asked on this application
The ApplicationQuestion table which stores the questions themselves.
The ApplicationAnswer table which stores the applicants answers to each
question.
The User table which shows who submitted this application if it was input
manually by a user.

As you can see a even a single dataset for this one form becomes rather
large. Do you think I should split it up even further for different
functions on the form? Maybe a different dataset for separate datagridviews
on the form?

Thanks,
Ryan

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uv**************@TK2MSFTNGP05.phx.gbl...
Kevin and Marina,

I had not seen that you both had answered already while replying.

Probably something in my eyes.

:-)

Others I had written "in addition".

So by this.

Cor

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> schreef in bericht
news:%2***************@TK2MSFTNGXA01.phx.gbl...
Hi Ryan,

In addition, I suggest you put all relational tables in a DataSet. There
is
no requirement for using how many DataSets on a form. It's just for your
convenience, which makes the developer clear of relations between tables.
HTH.

Kevin Yu
Microsoft Online Community Support

================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Jun 15 '06 #7
Ryan,

I would create datasets containing the main table (have a look at paging so
that you can limit them in lenght) and supporting tables. Probably do you in
most cases only need the name from the user, so loading that with all its
data is a waste of time. I assume that the user table contains probably only
the extra data not in the person data. Probably do you need that data
nowhere except there where you modify that and to logon, so it can probably
only contains forever only one row that you have selected with a where
clause (I don't know if you do it already however try to use
uniqueindentifiers which are Guids).

Probably is a lot related round a user, than try to get only the data from
that user with a where clause in your dataset.

(In my idea does a datasets not reflect your organisation as a database
does. A dataset is for me reflecting the way your data is used)

Just my thoughts,

Cor

"Ryan" <Ty****@newsgroups.nospam> schreef in bericht
news:u0**************@TK2MSFTNGP03.phx.gbl...
Just to give you all an example of one of my forms and an idea of what
type of dataset I need:

I have an application form which displays an application sent in by a
person (applying for a position on a public board). The form needs to
display information from all of the following relational tables:

The Person table containing contact information for that person.
The Application table containing general information about the application
(when and how it was submitted)
The Application_mm_Board table which contains a record for each board this
application is being submitted for.
The Board table which is needed for the name of each board the applicant
is applying for.
The Application_mm_Question table which contains a record for each
question asked on this application
The ApplicationQuestion table which stores the questions themselves.
The ApplicationAnswer table which stores the applicants answers to each
question.
The User table which shows who submitted this application if it was input
manually by a user.

As you can see a even a single dataset for this one form becomes rather
large. Do you think I should split it up even further for different
functions on the form? Maybe a different dataset for separate
datagridviews on the form?

Thanks,
Ryan

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uv**************@TK2MSFTNGP05.phx.gbl...
Kevin and Marina,

I had not seen that you both had answered already while replying.

Probably something in my eyes.

:-)

Others I had written "in addition".

So by this.

Cor

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> schreef in bericht
news:%2***************@TK2MSFTNGXA01.phx.gbl...
Hi Ryan,

In addition, I suggest you put all relational tables in a DataSet. There
is
no requirement for using how many DataSets on a form. It's just for your
convenience, which makes the developer clear of relations between
tables.
HTH.

Kevin Yu
Microsoft Online Community Support

================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)



Jun 15 '06 #8
Yea actually the User table is only needed as a lookup table to find the
User name (users are backend users of the application, not applicants which
are stored in the person table). So would you suggest putting lookup tables
in datasets by themselves (for drop-down boxes usually)? Since lookup
tables usually only need one or two fields from a table.

Ryan

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:OT**************@TK2MSFTNGP05.phx.gbl...
Ryan,

I would create datasets containing the main table (have a look at paging
so that you can limit them in lenght) and supporting tables. Probably do
you in most cases only need the name from the user, so loading that with
all its data is a waste of time. I assume that the user table contains
probably only the extra data not in the person data. Probably do you need
that data nowhere except there where you modify that and to logon, so it
can probably only contains forever only one row that you have selected
with a where clause (I don't know if you do it already however try to use
uniqueindentifiers which are Guids).

Probably is a lot related round a user, than try to get only the data from
that user with a where clause in your dataset.

(In my idea does a datasets not reflect your organisation as a database
does. A dataset is for me reflecting the way your data is used)

Just my thoughts,

Cor

"Ryan" <Ty****@newsgroups.nospam> schreef in bericht
news:u0**************@TK2MSFTNGP03.phx.gbl...
Just to give you all an example of one of my forms and an idea of what
type of dataset I need:

I have an application form which displays an application sent in by a
person (applying for a position on a public board). The form needs to
display information from all of the following relational tables:

The Person table containing contact information for that person.
The Application table containing general information about the
application (when and how it was submitted)
The Application_mm_Board table which contains a record for each board
this application is being submitted for.
The Board table which is needed for the name of each board the applicant
is applying for.
The Application_mm_Question table which contains a record for each
question asked on this application
The ApplicationQuestion table which stores the questions themselves.
The ApplicationAnswer table which stores the applicants answers to each
question.
The User table which shows who submitted this application if it was input
manually by a user.

As you can see a even a single dataset for this one form becomes rather
large. Do you think I should split it up even further for different
functions on the form? Maybe a different dataset for separate
datagridviews on the form?

Thanks,
Ryan

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uv**************@TK2MSFTNGP05.phx.gbl...
Kevin and Marina,

I had not seen that you both had answered already while replying.

Probably something in my eyes.

:-)

Others I had written "in addition".

So by this.

Cor

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> schreef in bericht
news:%2***************@TK2MSFTNGXA01.phx.gbl...
Hi Ryan,

In addition, I suggest you put all relational tables in a DataSet.
There is
no requirement for using how many DataSets on a form. It's just for
your
convenience, which makes the developer clear of relations between
tables.
HTH.

Kevin Yu
Microsoft Online Community Support

================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader
so
that others may learn and benefit from your issue.
================================================== ==========================
==========================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)



Jun 15 '06 #9
Yes

And if they change and you have too the complete information in a where
table, than change that table too and don't update it.

Cor

"Ryan" <Ty****@newsgroups.nospam> schreef in bericht
news:OG**************@TK2MSFTNGP02.phx.gbl...
Yea actually the User table is only needed as a lookup table to find the
User name (users are backend users of the application, not applicants
which are stored in the person table). So would you suggest putting
lookup tables in datasets by themselves (for drop-down boxes usually)?
Since lookup tables usually only need one or two fields from a table.

Ryan

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:OT**************@TK2MSFTNGP05.phx.gbl...
Ryan,

I would create datasets containing the main table (have a look at paging
so that you can limit them in lenght) and supporting tables. Probably do
you in most cases only need the name from the user, so loading that with
all its data is a waste of time. I assume that the user table contains
probably only the extra data not in the person data. Probably do you need
that data nowhere except there where you modify that and to logon, so it
can probably only contains forever only one row that you have selected
with a where clause (I don't know if you do it already however try to use
uniqueindentifiers which are Guids).

Probably is a lot related round a user, than try to get only the data
from that user with a where clause in your dataset.

(In my idea does a datasets not reflect your organisation as a database
does. A dataset is for me reflecting the way your data is used)

Just my thoughts,

Cor

"Ryan" <Ty****@newsgroups.nospam> schreef in bericht
news:u0**************@TK2MSFTNGP03.phx.gbl...
Just to give you all an example of one of my forms and an idea of what
type of dataset I need:

I have an application form which displays an application sent in by a
person (applying for a position on a public board). The form needs to
display information from all of the following relational tables:

The Person table containing contact information for that person.
The Application table containing general information about the
application (when and how it was submitted)
The Application_mm_Board table which contains a record for each board
this application is being submitted for.
The Board table which is needed for the name of each board the applicant
is applying for.
The Application_mm_Question table which contains a record for each
question asked on this application
The ApplicationQuestion table which stores the questions themselves.
The ApplicationAnswer table which stores the applicants answers to each
question.
The User table which shows who submitted this application if it was
input manually by a user.

As you can see a even a single dataset for this one form becomes rather
large. Do you think I should split it up even further for different
functions on the form? Maybe a different dataset for separate
datagridviews on the form?

Thanks,
Ryan

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uv**************@TK2MSFTNGP05.phx.gbl...
Kevin and Marina,

I had not seen that you both had answered already while replying.

Probably something in my eyes.

:-)

Others I had written "in addition".

So by this.

Cor

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> schreef in bericht
news:%2***************@TK2MSFTNGXA01.phx.gbl...
> Hi Ryan,
>
> In addition, I suggest you put all relational tables in a DataSet.
> There is
> no requirement for using how many DataSets on a form. It's just for
> your
> convenience, which makes the developer clear of relations between
> tables.
> HTH.
>
> Kevin Yu
> Microsoft Online Community Support
>
> ================================================== ==========================
> ==========================
> When responding to posts, please "Reply to Group" via your newsreader
> so
> that others may learn and benefit from your issue.
> ================================================== ==========================
> ==========================
>
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>



Jun 15 '06 #10

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

Similar topics

45
by: cody | last post by:
I've seen an Introduction on ADO.NET with its Datasets on .NET TV and Iam now wondering how it is realized/used in real world applications. I don't believe that one would create a dataset and add...
2
by: malcolm | last post by:
Hello, We have a robust (.NET 1.1 c# winforms) client-server application that utilizes many typed DataSets, typed DataTables and typed DataRows. Our application is a series of windows and popup...
16
by: Luqman | last post by:
Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ? Best Regards, Luqman
3
by: Dave | last post by:
We've created a robust client server application over the past 3 years on the .NET framework version 1.1 using c#. We layed all of our marbles in creating strongly typed datasets and for the most...
4
by: Ronald S. Cook | last post by:
I've always used untyped datasets. In a Microsoft course, it walks through creating typed datasets and harps on the benefits. It has you drag all these things around ..wizard, wizard, wizard......
7
by: Ryan | last post by:
Quite awile ago I posted to this newsgroup in regards to using Datasets in my VB 2005 application. About how many Datasets should be used.. a limit to the number of tables that should be included...
21
by: Peter Bradley | last post by:
Hi all, This post is sort of tangentially related to my earlier posts on configuration files for DLLs. Does anyone know how to create typed DataSets using VS2005's new DataSet designer, but...
7
by: John Sheppard | last post by:
Hello, I was curious as to peoples thoughts on using tools such as MyGeneration/CodeSmith to generate business objects as opposed to using datasets? We currently use datasets, for various...
12
by: BillE | last post by:
I'm trying to decide if it is better to use typed datasets or business objects, so I would appreciate any thoughts from someone with more experience. When I use a business object to populate a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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...

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.