Expression >
Forums Home
>
Feedback and Discussions Forums
>
Off-Topic Posts (Do Not Post Here)
>
Caching parts of an DataSet
Caching parts of an DataSet
Hi together,
first of all forgive my bad english. :-(
I've got the folowing situation:
I'm developing an ASP.NET application with the following specifications:
1. It has to support different database engines.
2. It has to be as fast as possible
Because of this specs I've decided to use a DataSet.
My current concept looks as follows:
When the application starts I create the DataSet with all tables (ca. 90 - 100) and relations but without the data.
The data will be loaded if they are needet.
To this scenario I've two questions:
1. Is it possible to put the data of each table in the cache?
2. If Q1 is yes is it possible to store the changed data back to the database bevor the memory is freed?
Thanks in advance
Waldemar- Moved byYichun_FengMSFTWednesday, November 04, 2009 2:45 AMASP.NET questions (From:ADO.NET DataSet)
All Replies
- Hi Waldemar,Though it should theoretically be possible to store the data in the cache, I am thinking storing data of all the 90-100 tables might not be the best way to do this.In any case, if your data is changing often, then the read from the cache will be minimal. You can always use a disconnected dataset to make sure you avoid round trips to the server. Is caching absolutely necessary?
- Hi technocrat_aspire
thanks for your reply.
I think I wasn't precise enough.
Perhaps an example will describe my target better:
The Database looks like this:
1. Table: User { idUser, UserName, Password } ca. 20 tuple
2. Table: EMails { idMail, idUser, Subject, Text, Attachment, ... } ca. 100000 tuple
3. Table: UserDetails { idUserDetails, idUser, Name, Address, State, ... } ca. 20 tuple
At the start of the application I create an DataSet which contains the structure of the database, and the data of User.
The tables EMails and UserDetails are emty.
When an User requests data from EMails the table is filled and the content should be stored in the cache for 20 seconds. After this period the data should be removed from the memory, but the DataSet should still have the information how the EMails table looks like.
As you can see in this scenario the table UserDetails has never any data, so it's content isn't cached.
Waldemar - Adding to Walder:
Updating, Inserting, and Deleting Records in a Dataset:
http://msdn.microsoft.com/en-us/library/aa984437(VS.71).aspx
Identifying and Returning Changed Rows:
http://msdn.microsoft.com/en-us/library/aa984113(VS.71).aspx
Regards,
Jai - Hi Waldemar,
Since your thread is related to ASP.NET, you can post in ASP.NET forums for better answer,
http://forums.asp.net/
There are more experts on APS.NET project.
Best Regards
Yichun Feng
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

