|
|
|
start date: Mon, 23 Jul 2007 18:02:43 +0200,
posted on: microsoft.public.dotnet.languages.vb.data
back
| Thread Index |
|
1
Michel Vanderbeke
|
|
2
Michel Posseth [MCP]
|
Detach my database from SQL SERVER
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
Date:Mon, 23 Jul 2007 18:02:43 +0200
Author:
|
Re: Detach my database from SQL SERVER
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" schreef in bericht
news:46a4d124$0$14233$ba620e4c@news.skynet.be...
> 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
>
>
Date:Thu, 26 Jul 2007 18:46:59 +0200
Author:
|
|
|