Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to know what makes the database non restorable
Message
From
25/03/2017 10:57:45
 
 
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:
01649326
Views:
41
>Documentation states that if the connection is not open when Fill() is called (which should be the case here) then the connection is automatically opened and *automatically closed* when the Fill() completes.

This is what I assumed for years. But, if that line executes, and if I stop the code right after that, click on the button to restore, it says the database cannot be opened exclusively.

>Where does this ensure that the DataAdapter is actually using loSQLConnection ?
>Using loSQLConnection As New SqlConnection(oApp.aConnection(nConnectionString, 1))
>   oCommand.Connection = loSQLConnection
>   oDataAdapter.Fill(oDataSet)
>End Using
It goes like this:
Public oDataSet As DataSet = Nothing
Private oSqlCommand As SqlCommand = Nothing
Private oSqlDataAdapter As SqlDataAdapter = Nothing

oSqlCommand.CommandText = lcSQL
oSqlDataAdapter.SelectCommand = oSqlCommand
oDataSet = New DataSet

Using loSQLConnection As New SqlConnection(oApp.aConnection(nConnectionString, 1))
   oSqlCommand.Connection = loSQLConnection
   oSqlDataAdapter.Fill(oDataSet)
End Using
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
Reply
Map
View

Click here to load this message in the networking platform