Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trying to know what makes the database non restorable
Message
De
24/03/2017 11:17:26
 
 
À
24/03/2017 10:33:56
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows Server 2012
Database:
Visual FoxPro
Application:
Web
Divers
Thread ID:
01649277
Message ID:
01649302
Vues:
47
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform