RE: ASP.NET data access
- From: "Elton W" <EltonW@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Jun 2005 05:32:05 -0700
Hi DwC,
Since you need disconnected data (DataSet), datareader is not necessary.
It’s better to use dataadapter to fill dataset. And if your individual
Dataset is from single DB table, you don’t have to create your own inserts,
updates and deletes methods. You can use dataadapter (combining with
commandbuilder) to fill dataset. Then you can use dataset.Update method to
update data back to DB (commandbuilder can automatically generate
corresponding update (insert, delete, or update) command(s).
HTH
Elton Wang
elton_wang@xxxxxxxxxxx
"DwC" wrote:
> Hi,
>
> We have a ms access database that we will be using to develop a website
> which would have fairly low usage levels.
>
> We have some experience with windows apps but not so much with asp.net
> projects. We have used ADO datasets previously for a windows application
> that we developed where the entire db was loaded into the dataset at the
> beginning of the application and the user made changes to the dataset
> which was then saved back to the db when the app was shut down.
>
> We now have to develop the asp app and we can't quite work out which
> technique we should be using:
>
> 1 - the original technique which seems like a huge waste of resources
> for a web app - loading the data from the db into the dataset each time
> the db access class is created. Which means that when data is required
> it is returned from the dataset saving a connection, but has used a heap
> of resources loading from the db in the first place. This also raises
> the question of when to synchronise the dataset and the db.
>
> 2 - using datareaders to directly access the data required. When the
> page loads it creates a db access class which has a connection and
> methods which when called open the connection, pack the data into the
> return object (which could be strings, collection, or user defined)
> using the datareader and then close the connection and return the packed
> object. We would in this case have insert methods which would then use
> inserts, updates and deletes to directly update the database.
>
> 3 - using datasets from each method in the db access class instead of
> one large dataset. So the methods would be like:
> private DataSet GetProducts() etc..
> instead of one large dataset. We would then have a update or delete
> method or whatever which would take back a dataset and make the changes
> directly to the database. The problem that this technique seems to have
> is that you are creating a dataset in each method, which is failur
> repetitive and may only contain a few rows.
>
> If anyone can help by totally ruling out any of these options or
> providing different techniques it would be greatly appreciated. I have
> done some research about this but haven't been able to find a really
> good resource that explains the preferred technique for a web app.
>
> Thanks in advance.
>
.
- Follow-Ups:
- Re: ASP.NET data access
- From: Sean M
- Re: ASP.NET data access
- References:
- ASP.NET data access
- From: DwC
- ASP.NET data access
- Prev by Date: Form Submit Issue
- Next by Date: Re: JPG info
- Previous by thread: ASP.NET data access
- Next by thread: Re: ASP.NET data access
- Index(es):
Relevant Pages
|
Loading