DataSet Question

  • Thread starter Thread starter MJ
  • Start date Start date
M

MJ

In my application at runtime I fill a dataset from a database using a stored
procedure and then bind it to a combo box. My question is after I bind it
is the dataset still in memory? I do this for 6 or 7 combo boxes and I do
not need the dataset after I bind it.

Thanks in advance
 
Thanks for Greg's reply.

Hi MJ,

I agree with Greg's idea and would like to offer some additional
information on this issue.

Then Common Language Runtime uses Garbage Collection to clear the useless
objects on the managed heap. When there is a reference pointing the
dataset, it will never be considered as a garbage to be collected. In fact,
you needn't worry about the problem with releasing memory on the managed
heap. Just leave it to the CLR. If you don't want the dataset, try to use
ComboBox.Items.Add() method to add items instead of binding it. Then the
dataset might be collected next time the CLR performs GC.

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| From: "MJ" <[email protected]>
| Subject: DataSet Question
| Date: Tue, 14 Oct 2003 12:33:47 -0600
| Lines: 8
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: 64.207.45.37
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:63639
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| In my application at runtime I fill a dataset from a database using a
stored
| procedure and then bind it to a combo box. My question is after I bind it
| is the dataset still in memory? I do this for 6 or 7 combo boxes and I do
| not need the dataset after I bind it.
|
| Thanks in advance
|
|
|
 
Back
Top