473,395 Members | 1,539 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,395 software developers and data experts.

Table adapters dispose themselves?

dgk
Should I dispose of table adapters and data tables and rows or do they
garbage collect themselves?
Oct 16 '07 #1
4 3429
Do they implement IDisposable? e.g, do they have a Dispose method?
If so, you may call it. Otherwise, not to worry, the garbage man will get
around to it.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"dgk" wrote:
Should I dispose of table adapters and data tables and rows or do they
garbage collect themselves?
Oct 16 '07 #2
dgk
>"dgk" wrote:
>
>Should I dispose of table adapters and data tables and rows or do they
garbage collect themselves?

>On Tue, 16 Oct 2007 11:48:01 -0700, Peter Bromberg [C# MVP] <pb*******@yahoo.yohohhoandabottleofrum.comwrote :

Do they implement IDisposable? e.g, do they have a Dispose method?
If so, you may call it. Otherwise, not to worry, the garbage man will get
around to it.
-- Peter
Is that how you tell whether to dispose of something, it has a dispose
method? I know for graphic objects you have to dispose them, and most
objects you don't have to.

Data connections normally have to be disposed of, and the table
adapter is pretty much a data adapter with a built-in connection
object (with some queries along for the ride).

I guess it's safer to just call Dispose on them.
Oct 16 '07 #3
in general objects only implement IDispose if they need it, though many
have a alternate method like Close()

-- bruce (sqlwork.com)

dgk wrote:
>"dgk" wrote:
>>Should I dispose of table adapters and data tables and rows or do they
garbage collect themselves?


>On Tue, 16 Oct 2007 11:48:01 -0700, Peter Bromberg [C# MVP] <pb*******@yahoo.yohohhoandabottleofrum.comwrote :

Do they implement IDisposable? e.g, do they have a Dispose method?
If so, you may call it. Otherwise, not to worry, the garbage man will get
around to it.
-- Peter

Is that how you tell whether to dispose of something, it has a dispose
method? I know for graphic objects you have to dispose them, and most
objects you don't have to.

Data connections normally have to be disposed of, and the table
adapter is pretty much a data adapter with a built-in connection
object (with some queries along for the ride).

I guess it's safer to just call Dispose on them.
Oct 16 '07 #4
dgk
On Tue, 16 Oct 2007 12:58:49 -0700, bruce barker <no****@nospam.com>
wrote:
>in general objects only implement IDispose if they need it, though many
have a alternate method like Close()

-- bruce (sqlwork.com)
Thanks. I guess if it has dispose, I''l call it. I don't think there's
a downside.
Oct 17 '07 #5

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

Similar topics

11
by: Ken Durden | last post by:
I am in search of a comprehensive methodology of using these two object cleanup approaches to get rid of a number of bugs, unpleasantries, and cleanup-ordering issues we currently have in our...
2
by: Nuno Magalhaes | last post by:
In a sample code I do something like this: //Populate IP List IPHost=Dns.GetHostByName(Dns.GetHostName()); DefaultIPCombo.Items.Clear(); DefaultIPCombo.Items.Add(IPHost.AddressList.ToString());...
0
by: Bennett Haselton | last post by:
It seems whenever I add a new field to a database table that's queried by DataAdapters in my project, I get run-time errors because I don't go back and re-generate all the DataAdapters to read the...
156
by: Dennis | last post by:
Ok, I'm trying to dispose of every object that I create that has a dispose method based on advice from this newsgroup. However, I'm not sure how to dispose of the following object that was created...
1
by: Bruce HS | last post by:
I'm using VS2005, VB, WinForms I’ve developed forms using those nice wizards Microsoft provides. However, I’m running into a couple of complications trying to work with the resulting Table...
2
by: =?Utf-8?B?SmFtZXNJRURPVE5FVA==?= | last post by:
I have an application (ASP.NET 2.0/SQL Server 2005) which makes heavy use of table adapters for pulling records from SQL. Under heavy load, we get a lot of SQL Server Timeout errors. We have run a...
10
by: Agnes | last post by:
Does dataset dispose will lead the related dataadpator , or database will dispose also ? Or I need to dispose them one by one ??
12
by: Randy | last post by:
Hi, Trying to pass along a table row delete to the datasource, but I'm crashing. Here is the code: Private Sub btnDeleteIngr_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles...
0
by: gilbes | last post by:
I have been searching for a solution to this for a while now and everything I have found has lead me down the wrong path. Any assistance you guys could give would be much appreciated. I would...
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: 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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.