Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Windows Small Business Server > reopened connection fails at first [re]use

Reply
Thread Tools Display Modes

reopened connection fails at first [re]use

 
 
Danny
Guest
Posts: n/a

 
      02-14-2011
When I need to execute a backup-script, I close the user-connection
and reopen the database with an admin-connection to allow the stored
procedure to execute.
This works, but when after that I re-open the user-connection, the
state is 1 (=open), but at the first ' Dim sqlCmd As New
SqlCommand(sql, CONN) sqlCmd.ExecuteScalar' I get the error 'no
proceess at the other end' and in fact the connection (CONN) closes.
I tried with/without the CONN.dispose and/or CONN = New
SqlConnection(UserConnectionString), but always the same result.
True, other stations may still have some handle on the database, so me
closing is maybe not enough, but that is an issue that I will tackle
later.

CONN.Close() 'can't restore if still open
CONN.Dispose()
Using sc As New SqlConnection(AdminConnectionString)
sc.Open()
Dim CMDsc As New SqlCommand("exec [dbo].
[sp_backup_PROD_2_TEST]", sc)
CMDsc.ExecuteNonQuery()
CMDsc.Dispose()
End Using
're-open the connection
CONN = New SqlConnection(UserConnectionString)
CONN.Open()

Regards
 
Reply With Quote
 
 
 
 
Dr Vangel
Guest
Posts: n/a

 
      02-21-2011
>When I need to execute a backup-script, I close the user-connection
>and reopen the database with an admin-connection to allow the stored
>procedure to execute.
>This works, but when after that I re-open the user-connection, the
>state is 1 (=open), but at the first ' Dim sqlCmd As New
>SqlCommand(sql, CONN) sqlCmd.ExecuteScalar' I get the error 'no
>proceess at the other end' and in fact the connection (CONN) closes.
>I tried with/without the CONN.dispose and/or CONN = New
>SqlConnection(UserConnectionString), but always the same result.
>True, other stations may still have some handle on the database, so
>me
>closing is maybe not enough, but that is an issue that I will tackle
>later.
>
> CONN.Close() 'can't restore if still open
> CONN.Dispose()
> Using sc As New SqlConnection(AdminConnectionString)
> sc.Open()
> Dim CMDsc As New SqlCommand("exec [dbo].
>[sp_backup_PROD_2_TEST]", sc)
> CMDsc.ExecuteNonQuery()
> CMDsc.Dispose()
> End Using
> 're-open the connection
> CONN = New SqlConnection(UserConnectionString)
> CONN.Open()
>
>Regards


----------------------------
posted via Grepler.com -- poster is authenticated.
begin 644
en

 
Reply With Quote
 
Dr Vangel
Guest
Posts: n/a

 
      02-21-2011
>When I need to execute a backup-script, I close the user-connection
>and reopen the database with an admin-connection to allow the stored
>procedure to execute.
>This works, but when after that I re-open the user-connection, the
>state is 1 (=open), but at the first ' Dim sqlCmd As New
>SqlCommand(sql, CONN) sqlCmd.ExecuteScalar' I get the error 'no
>proceess at the other end' and in fact the connection (CONN) closes.
>I tried with/without the CONN.dispose and/or CONN = New
>SqlConnection(UserConnectionString), but always the same result.
>True, other stations may still have some handle on the database, so
>me
>closing is maybe not enough, but that is an issue that I will tackle
>later.
>
> CONN.Close() 'can't restore if still open
> CONN.Dispose()
> Using sc As New SqlConnection(AdminConnectionString)
> sc.Open()
> Dim CMDsc As New SqlCommand("exec [dbo].
>[sp_backup_PROD_2_TEST]", sc)
> CMDsc.ExecuteNonQuery()
> CMDsc.Dispose()
> End Using
> 're-open the connection
> CONN = New SqlConnection(UserConnectionString)
> CONN.Open()
>
>Regards


----------------------------
posted via Grepler.com -- poster is authenticated.
begin 644
en

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
connection fails daily fcsark9handler Windows Vista Mail 8 07-08-2010 06:07 PM
Windows Mail Connection Conflict with Mobile Partner Scroobs Windows Vista Support 0 04-09-2010 09:05 AM
Re: Active Directory problems/dcdiag error kj [SBS MVP] Windows Small Business Server 3 03-24-2010 09:19 PM
uninstalling IE8 Jo-Anne Internet Explorer 18 12-14-2009 08:02 PM
Wireless Network Connection Fails to Install Scigaithris Windows Vista Hardware 1 02-27-2008 10:12 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59