Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to know what makes the database non restorable
Message
From
23/03/2017 19:17:45
 
 
To
23/03/2017 18:02:18
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:
01649286
Views:
41
My data class calls a method to get the schema. It had this:
Using loSQLConnection As New SqlConnection(oApp.aConnection(nConnectionString, 1))
   loSQLConnection.Open()
   oCommand.Connection = loSQLConnection
   oDataReader = oCommand.ExecuteReader(CommandBehavior.SchemaOnly)
   oDataTable = oDataReader.GetSchemaTable
End Using
The loSQLConnection.Open() was not necessary. Once removed, no connectivity remained.

The updated code is as follow:
Using loSQLConnection As New SqlConnection(oApp.aConnection(nConnectionString, 1))
   loSQLConnection.Open()
   oCommand.Connection = loSQLConnection
   oDataReader = oCommand.ExecuteReader(CommandBehavior.SchemaOnly)
   oDataTable = oDataReader.GetSchemaTable
End Using
But, later on, still in the DataAdapter.Fill() command, this applies a permanent connection to something.
Using loSQLConnection As New SqlConnection(oApp.aConnection(nConnectionString, 1))
   oCommand.Connection = loSQLConnection
   oDataAdapter.Fill(oDataSet)
End Using
When that command executes, something remains stuck in memory. I have tried, oCommand.Connection.Close(), oCommand.Dispose(), oDataAdapter = Nothing and all of that at the same time.

Do you see anything in there that is missing?
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