Re: Problems with connection management
- From: Jan Hyde <StellaDrinker@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 16 May 2006 11:13:15 +0100
"Mattinsalto" <superdrive01@xxxxxxxxx>'s wild thoughts were
released on 16 May 2006 01:00:29 -0700 bearing the following
fruit:
Hello, I am trying to make a program that whenever it must do any
operation against the data base verifies that the connection is valid.
In order to test it I stop SQL server service and restart it. I have
tried to verify the state of the connection with
"connection.state", but has been useless because the state was
always open, although I restarted the service, so it crashed. I have
decided to use a new connection each time i have to connect to the
database, but it crash too. this is the code:
''Everytime I have to connect to DB I call a function who creates a new
connection:
''The conn variable is global
...
conn = Nothing
iniSQL()
...
Public sub iniSQL()
Try
conn = New System.Data.SqlClient.SqlConnection(GetConStr())
That's not VB code, this group is for VB6 and below, for
dotnet related questions try one of the groups with 'dotnet'
in it's name.
Jan Hyde (VB MVP)
--
Perspire: How church builders calculate their construction costs
(Ray Hand)
.
- Follow-Ups:
- Re: Problems with connection management
- From: Mattinsalto
- Re: Problems with connection management
- References:
- Problems with connection management
- From: Mattinsalto
- Problems with connection management
- Prev by Date: Manual
- Next by Date: Re: Problems with connection management
- Previous by thread: Problems with connection management
- Next by thread: Re: Problems with connection management
- Index(es):
Relevant Pages
|