Re: disposing the database object??
- From: "Miha Markic [MVP C#]" <miha at rthand com>
- Date: Thu, 14 Dec 2006 15:23:42 +0100
"ajmastrean" <ajmastrean@xxxxxxxxx> wrote in message news:1166099283.884550.314080@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
There is no .Dispose() function for the Database object.
The OP did not show the class structure there, but I suppose the
garbage collector will handle disposing that object when he exits the
function or when the entire class is disposed (whatever the case may
be).
Only the former is possible while the later isn't.
Yes, it is very possible that Database instance doesn't need disposing...
If he simply wants to keep his database objects/connections in order,
then there is no real issue. The database object returned by
DatabaseFactory.CreateDatabase() is not responsible for closing
connections, the db.ExecuteScalar() will do that.
--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
.
- References:
- Re: disposing the database object??
- From: Miha Markic [MVP C#]
- Re: disposing the database object??
- From: ajmastrean
- Re: disposing the database object??
- Prev by Date: Re: CommandTimeout
- Next by Date: Installing an application in local network!, Help Please
- Previous by thread: Re: disposing the database object??
- Next by thread: Re: disposing the database object??
- Index(es):
Relevant Pages
|