473,379 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

dataset question, might be obvious

Two parter:

1.) Which is better to fill a listbox or dropdownlist, a dataset or
datareader? Both use a connection, but dataset uses memory. And if you're
only fill a dropdownlist or listbox does it matter? Maybe if you need the
same data for another control?

2.) If the dataset (datatable) uses memory, then when do you set to nothing?
I know the connection close automatically, but what about the memory useage?

thanx.
Nov 19 '05 #1
1 906
Hi chris:

1) DataSets can be cached, while data readers cannot be cached - that
might be one reason to prefer a DataSet over a reader.

2) You don't need to manage the memory at all. The garbage collector
will reclaim the memory when the runtime needs more space. Setting a
variable to Nothing will *rarely*, if ever, have a beneficial impact.
Just let the system manage memory, but make sure to clean up the
connections and data readers with a Close.

--
Scott
http://www.OdeToCode.com/blogs/scott/
On Fri, 11 Feb 2005 17:25:02 -0800, "Chris"
<Ch***@discussions.microsoft.com> wrote:
Two parter:

1.) Which is better to fill a listbox or dropdownlist, a dataset or
datareader? Both use a connection, but dataset uses memory. And if you're
only fill a dropdownlist or listbox does it matter? Maybe if you need the
same data for another control?

2.) If the dataset (datatable) uses memory, then when do you set to nothing?
I know the connection close automatically, but what about the memory useage?

thanx.


Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Bruce Stockwell | last post by:
the setup: Webservice/WinClient application/SQL server. VS.Net (visual basic) winform wizard creates a simple form with load cancel cancelall and datagrid bound to a simple Dataset with one...
1
by: Jeff Wilson | last post by:
Am relatively new to .NET and am trying to use it to create a usage billing system that can process a million or two records each day. Am currently using a simple system written in C that uses...
2
by: James Ankrom | last post by:
Why does this fail? Dim relResources As New Data.DataRelation("Application_Resources", ..Tables("User_Applications").Columns("Application_id"),...
5
by: Mike | last post by:
I need to expand the DataSet class by inheriting from it and adding functions that work on the data in the tables. However, since I can't upcast how can I get my base DataSet object assigned an...
4
by: Bas Hamer | last post by:
I guess I don't know how to word it better than that. Our company has machines that generate log file in our own proprietary language. A while back I wrote a class that took one of these files...
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
9
by: Mr Newbie | last post by:
HI People, Thanks to all who helped me earlier on the subject of @@IDentity. However, I seem to have hit another snagette! My DataSet contains two tables from the SQL Server. lets say Master...
1
by: Neil | last post by:
Is it possible to reference the dataset of a sqldatasource from code? I've looked at the properties for the sqldatasource but don't see anything obvious. In particular, I have a bit field in the...
8
by: Harry Strybos | last post by:
Visual Studio 2005 - SP1 - VB.Net on WinXP SP2 I add a typed dataset to my solution and get the following errors : Error 1 sub 'ReadXmlSerializable' cannot be declared 'Overrides' because it...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.