Groups | Blog | Home
all groups > vb.net data > july 2007 >

vb.net data : Detach my database from SQL SERVER


Michel Vanderbeke
7/23/2007 6:02:43 PM
Hello,

When I have closed my appliciation in VB.NET, and I try to detach my
database from SQL SERVER, I often get a message that the database cannot be
detatched, because it is still in use.
So I think there is some code missing in my application (in the
MDI_FormClosing?) to make my database is no longer in use.

I already put a Connection.Close in the FormClosing also in a Finally-block
of that FormClosing, but that does not seem to be enough.

Can someone help me with that?

Many thanks and greetings,

Michel

Michel Posseth [MCP]
7/26/2007 6:46:59 PM

Even if the connection is closed , it can still be hanging around in the
connection pool

read this :
http://msdn2.microsoft.com/en-us/library/8xx3tyca(VS.80).aspx

if possible ( if you use VB.Net 2005 ) use using staments with all your
database actions inclusive setting up your connection object
( setting up a program wide connection is not necesary annymore because of
ADO.Net`s superior pooling mechanism )


regards

Michel





"Michel Vanderbeke" <michel.vanderbeke@skynet.be> schreef in bericht
news:46a4d124$0$14233$ba620e4c@news.skynet.be...
[quoted text, click to view]

AddThis Social Bookmark Button