Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Caching / May 2004

Tip: Looking for answers? Try searching our database.

DataSet vs DataTable

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Thomas - 16 May 2004 04:40 GMT
Hope this isn't too much of a newb question. I'll ask it in the context of what I'm trying to do so that maybe it's more clear. I'm working on a site that has a list of featured products that I'd like to store in a table form in cache, since this info doesn't change much and will be used on many pages. Here is what I'm wondering:

Is it better to store this information in a DataTable or a DataSet? This table does not need to have any sort of relationship with other tables that will be in cache. Do I avoid any overhead related to this by not using a DataSet? Whether this is true or not - does it make it harder for the cache to manage itself if you have a DataSet containing multiple tables in cache as opposed to individual DataTables - for memory management, won't cache have to remove the entire DataSet if resources run low, as opposed dropping individual DataTables?

And I suppose the last question I should ask is: Would I be better of using another way of storing this information, like an ArrayList or something? I just need to use it as a datasource for a datalist (w/datakeys), and it's nice to be able to reference column names when I'm using databinding expressions.

Thanks in advance! I'm probably misunderstanding a major concept somewhere, so feel free to point out the obvious!
Alvin Bruney [MVP] - 17 May 2004 17:19 GMT
see inline

Signature

Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok


>Is it better to store this information in a DataTable or a DataSet?
It depends. A dataset is a collection of datatables. A datatable is a
collection of rows and columns.
The dataset has more overhead and is *fatter (for transmission purposes)
than the datatable but this overhead allows for easier management and added
functionality. A dataset also has a higher level of abstraction compared to
a datatable or an array list which makes it more suitable for component
development in n-tired situations.

>Whether this is true or not - does it make it harder for the cache to
>manage itself if you have a DataSet containing multiple tables in cache as
>opposed to individual DataTables
The cache doesn't concern itself with the type of data it stores. It just
needs to be serializable
and able to fit in memory.

> - for memory management, won't cache have to remove the entire DataSet if
> resources run low, as opposed dropping individual DataTables?
The cache removes objects. If it is a dataset the entire dataset goes, if it
is a table, the entire table goes.

>And I suppose the last question I should ask is: Would I be better of using
>another way of storing this information, like an ArrayList or something?
An arraylist is fine.  But notice, the simpler data structure u use the less
functionality and manageability you have. For example, an array list does
not have the ability to manage thru rows and columns.

>I just need to use it as a datasource for a datalist (w/datakeys), and it's
>nice to be able to reference column names when I'm using databinding
>expressions.
Choose your datastructure according to the application purpose and project
requirements and not necessarily based on convention.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.