ASP.NET data access
- From: DwC <email@xxxxxxxxx>
- Date: Tue, 28 Jun 2005 18:37:12 +1000
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: Elton W
- RE: ASP.NET data access
- Prev by Date: Re: objectdatasource: update parameter is a object?
- Next by Date: Problems of Starting Application
- Previous by thread: value="" option on input type="file" in ASP.NET
- Next by thread: RE: ASP.NET data access
- Index(es):
Relevant Pages
|