PC Review


Reply
Thread Tools Rate Thread

DataSet Question

 
 
Jack
Guest
Posts: n/a
 
      14th Oct 2003
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


 
Reply With Quote
 
 
 
 
Kevin Yu [MSFT]
Guest
Posts: n/a
 
      15th Oct 2003
Hi Jack,

The 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: "Jack" <(E-Mail Removed)>
| Subject: DataSet Question
| Date: Tue, 14 Oct 2003 16:39:28 -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: <(E-Mail Removed)>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: 64.207.45.37
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
8.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:63656
| 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
|
|
|

 
Reply With Quote
 
 
 
 
Jack
Guest
Posts: n/a
 
      15th Oct 2003
Thanks for the reply. So, my question is when I pass in
the dataset to a method that binds it and when the
dataset goes out of scope the GC will release it when it
collects? ANother question was when it is bound to the
combobox is it not release into memory until the form is
closed?

Thanks



>-----Original Message-----
>Hi Jack,
>
>The 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: "Jack" <(E-Mail Removed)>
>| Subject: DataSet Question
>| Date: Tue, 14 Oct 2003 16:39:28 -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: <(E-Mail Removed)>
>| Newsgroups: microsoft.public.dotnet.framework.adonet
>| NNTP-Posting-Host: 64.207.45.37
>| Path:
>cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!

TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
>8.phx.gbl!TK2MSFTNGP12.phx.gbl
>| Xref: cpmsftngxa06.phx.gbl

microsoft.public.dotnet.framework.adonet:63656
>| 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
>|
>|
>|
>
>.
>

 
Reply With Quote
 
Kevin Yu [MSFT]
Guest
Posts: n/a
 
      16th Oct 2003
Hi Jack,

Whenever there is a reference to the dataset, it will not be collected. So
when you bind the dataset to a combobox, only when the combobox goes out of
scope will the GC collect the dataset. Generally, the ComboBox goes out of
scope when the form closes.

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

--------------------
| Content-Class: urn:content-classes:message
| From: "Jack" <(E-Mail Removed)>
| Sender: "Jack" <(E-Mail Removed)>
| References: <(E-Mail Removed)>
<(E-Mail Removed)>
| Subject: RE: DataSet Question
| Date: Wed, 15 Oct 2003 08:01:38 -0700
| Lines: 74
| Message-ID: <2bab401c3932d$3bfa32d0$(E-Mail Removed)>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcOTLTv6gc/HgafyT+CA7aZc0NrnAQ==
| Newsgroups: microsoft.public.dotnet.framework.adonet
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:63697
| NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| Thanks for the reply. So, my question is when I pass in
| the dataset to a method that binds it and when the
| dataset goes out of scope the GC will release it when it
| collects? ANother question was when it is bound to the
| combobox is it not release into memory until the form is
| closed?
|
| Thanks
|
|
|
| >-----Original Message-----
| >Hi Jack,
| >
| >The 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: "Jack" <(E-Mail Removed)>
| >| Subject: DataSet Question
| >| Date: Tue, 14 Oct 2003 16:39:28 -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: <(E-Mail Removed)>
| >| Newsgroups: microsoft.public.dotnet.framework.adonet
| >| NNTP-Posting-Host: 64.207.45.37
| >| Path:
| >cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!
| TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
| >8.phx.gbl!TK2MSFTNGP12.phx.gbl
| >| Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.framework.adonet:63656
| >| 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
| >|
| >|
| >|
| >
| >.
| >
|

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N Microsoft Dot NET Framework 3 31st Oct 2003 02:05 PM
Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N Microsoft Dot NET Framework 2 31st Oct 2003 03:39 AM
Re: copy/move rows from a dataset to another dataset? Stephen Muecke Microsoft ADO .NET 1 22nd Jul 2003 04:56 PM
Re: Merging untyped dataset into a typed dataset (GUID problems) Lewis Edward Moten III Microsoft ADO .NET 0 14th Jul 2003 09:13 PM
GetChanges in a Typed Dataset returns a DataSet?? Paddy Microsoft ADO .NET 1 5th Jul 2003 05:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:36 PM.