need guidance on - dataset, view and bit of ASP .NET

L

Likhith Areekkal

Hi,

I am new to web programming and am using ASP .NET (C#) and ADO .NET to
develop a web based room booking application. I have been reading a lot of
books on ADO .NET and ASP .NET and I have a few basic question which I am
totally confused about.

Please note that I am a beginner and you have to see the questions in that
angle. I may be vague on my questions - if it is not clear please guide me.

1. Regarding dataset:

(a) I have one bookings table which takes in all the booking information -
ID of
the person, date booked, start time, end time and room booked. Update,
Delete, Add mainly happens in this database. there are other tables but the
main one is the above mentioned table.

Question:

Does every client who accesses the web application end up creating a
dataset?
OR
Is there only one dataset which is accessed by all clients?


(b) If I have a view in the database - Can dataset carry the same view? or
should
we make up a view in the dataset?
If the question is unclear to you it is because I myself is not clear about
what I shold be asking. Could you please through some light on views in
dataset.


2. Regarding ASP .NET:

If it is only one dataset which part of the program do I set this dataset up
so that the application creates only one dataset. ?

If I do it in the pageload section will it not end up creating dataset for
every client?

Are you with me? If the above question is not clear, please let me know.

The book talks about how to create the dataset - gives the code. But it
doesn't actually tell me which part of the program should the code for the
dataset be in.


Thank you and I appreciate your guidance.

Best Regards,
Li
 
F

Fabio

Likhith said:
Does every client who accesses the web application end up creating a
dataset?

Yes. A dataset is an in-memory representation of the database (or a subset of
it) and each client will create its own dataset.
(b) If I have a view in the database - Can dataset carry the same view? or
should
we make up a view in the dataset?

A view is treated exactly like a table, from the DB engine point of view. You
can have multiple tables in a dataset, ie you can have your table, your view or
both.
If it is only one dataset which part of the program do I set this dataset up
so that the application creates only one dataset. ?

It really depends on the structure of your program: keep in mind that ADO.NET is
a disconnected architecture, therefore once you pull your data from the database
the connection can be closed. Try to avoid repeating trips to the database where
possible.

Have fun!
 
L

Likhith Areekkal

Thank you.



Fabio said:
Likhith said:
Does every client who accesses the web application end up creating a
dataset?

Yes. A dataset is an in-memory representation of the database (or a subset
of it) and each client will create its own dataset.
(b) If I have a view in the database - Can dataset carry the same view?
or should
we make up a view in the dataset?

A view is treated exactly like a table, from the DB engine point of view.
You can have multiple tables in a dataset, ie you can have your table,
your view or both.
If it is only one dataset which part of the program do I set this dataset
up
so that the application creates only one dataset. ?

It really depends on the structure of your program: keep in mind that
ADO.NET is a disconnected architecture, therefore once you pull your data
from the database the connection can be closed. Try to avoid repeating
trips to the database where possible.

Have fun!

--
Software is like sex: it's better when it's free -- [Linus Torvalds]

Fabio Marini - A+, RHCT, MCDBA, MCAD.NET
To reply: news [at] mamakin1976 [dot] plus [dot] com
 

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