Re: Problems with connection management



"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)

.



Relevant Pages

  • Problems with connection management
    ... operation against the data base verifies that the connection is valid. ... ''The conn variable is global ... The code works fine if I don't stop and restart the sql Server service. ...
    (comp.lang.basic.visual.misc)
  • Re: Major Browser Problems only fixed at reboot
    ... I meant that when I have experienced this problem prior to doing the fixes ... When I say speed of connection, I meant the rate at which number of packets ... I did empty the TIF. ... >>>Restart the system. ...
    (microsoft.public.windowsxp.general)
  • Re: Cant connect to the internet
    ... Restart your computer ... Open Network Connections ... Right click LAN connection and choose Properties ... You can also try to run computer in Safe Mode With Networking (press F8 ...
    (microsoft.public.windowsxp.network_web)
  • RE: Error 0x800C0005
    ... if it's a bit long but there's a connection here I'm sure). ... AND got this 0x800C0005 error message for windows ... prompted - DO NOT RESTART YOUR COMPUTER but try everything again i.e. ... I had previously installed Norton Internet Security Family Edition but had ...
    (microsoft.public.windowsupdate)
  • Re: error 0x800C0005
    ... if it's a bit long but there's a connection here I'm sure). ... The Microsoft Knowledge Base referenced an old CAB file that needed to be ... AND got this 0x800C0005 error message for windows ... prompted - DO NOT RESTART YOUR COMPUTER but try everything again i.e. ...
    (microsoft.public.windowsupdate)