Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 21st, 2005, 03:44 AM
Authorized User
 
Join Date: Apr 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ranakdinesh
Default destroy dataset

while i was writing a code to access data from database to dataset i realized that that once the dataset is created it resides in the memory of the system till the time application is running. sometime we dont need the dataset any more after using it i think if this is the case then we must destroy the dataset to release the system memory resources how we can destroy a dataset when it is not required any more

dinesh Rana
__________________
dinesh Rana
 
Old April 21st, 2005, 04:04 AM
Registered User
 
Join Date: Apr 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to prajesh_jha
Default

hi ranakdinesh
 I think dispose method of dataset will do that,check it

Dim ds As New DataSet
ds.Dispose()

try it

 
Old April 21st, 2005, 10:18 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

firstly what kind of application you mean?

(supposed it's a windows app)
if you declared your dataset globally,it should resides in the memory

if you declared it locally it would be disposed automatically by the GC in the best possible time

you would need dispose method(IDisposable) when you have an unmanaged resource

(in some managed objects(like pen) we call Dispose method as soon as possible)

_____________
Mehdi.
software student.
 
Old April 21st, 2005, 10:31 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

any way if your DataSet contains huge info and you don't need it anymore just earase the info(GC is responsible for disposing not you)

theDataSet.Clear();

_____________
Mehdi.
software student.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting a untyped dataset to a typed dataset daphnean Visual Studio 2005 0 July 13th, 2006 01:16 AM
how to destroy session when window is closed chayanvinayak PHP How-To 1 June 1st, 2006 06:18 AM
how to destroy static variable? janedong VS.NET 2002/2003 2 November 30th, 2004 10:26 PM
who destroy static variables(no instance of class) MikoMax J2EE 1 March 31st, 2004 08:01 AM
Re: SQL Server dataset to ACCESS dataset dazzer ADO.NET 0 March 22nd, 2004 05:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.