Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to know what makes the database non restorable
Message
From
24/03/2017 11:17:26
 
 
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows Server 2012
Database:
Visual FoxPro
Application:
Web
Miscellaneous
Thread ID:
01649277
Message ID:
01649302
Views:
46
>IIRC ADO.NET maintains a connection pool and your new SqlConnection() will just grab (or release) an existing connection from the pool. I think there's a ClearPool method - check this:
> https://msdn.microsoft.com/en-us/library/8xx3tyca(v=vs.110).aspx

This seems to work for others but it does not work for me.

Basically, I have added the clear pool line before my restore procedure:
' In order to restore, we need to clear the connection pool
System.Data.SqlClient.SqlConnection.ClearAllPools()

oStatus.Text = lcRestoringDatabase + "..."

loRestore.Devices.AddDevice(cPath + "\" + cDatabase + ".bak", Microsoft.SqlServer.Management.Smo.DeviceType.File)
loRestore.Database = cDatabase
loRestore.Action = Microsoft.SqlServer.Management.Smo.RestoreActionType.Database
loRestore.ReplaceDatabase = True
loRestore.PercentCompleteNotification = 1
AddHandler loRestore.PercentComplete, AddressOf ProgressEventHandler2
loRestore.SqlRestore(loServer)
And, I still cannot get exclusive use of the database.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform