Click here to Skip to main content
16,004,828 members
Home / Discussions / Database
   

Database

 
GeneralRe: DTS transforming text to datetime format Pin
leezardd8-Jul-04 9:22
leezardd8-Jul-04 9:22 
GeneralRe: DTS transforming text to datetime format Pin
Grimolfr9-Jul-04 2:17
Grimolfr9-Jul-04 2:17 
GeneralRe: DTS transforming text to datetime format Pin
leezardd9-Jul-04 4:41
leezardd9-Jul-04 4:41 
GeneralMultiple Queries in ADO Pin
brdavid7-Jul-04 14:39
brdavid7-Jul-04 14:39 
GeneralRe: Multiple Queries in ADO Pin
Michael Potter8-Jul-04 3:29
Michael Potter8-Jul-04 3:29 
GeneralRe: Multiple Queries in ADO Pin
brdavid8-Jul-04 4:26
brdavid8-Jul-04 4:26 
GeneralRe: Multiple Queries in ADO Pin
Michael Potter8-Jul-04 5:01
Michael Potter8-Jul-04 5:01 
Generalcan't detach database Pin
dmbf1b57-Jul-04 10:38
dmbf1b57-Jul-04 10:38 
Hi,

When my app starts, one of the first things it does is go out and look at the database to make sure it is the correct version. If not, it runs the necessary scripts to bring the database version up to the current code version.

The problem is, after I execute the following code to get the database version, when I try to detach the database, I get the error:
"Cannot detach the database 'Training' because it is currently in use."

I have verified that if I skip the code below, the detach works fine. It seems that once I make a connection to the database, there is no way to get rid of it. I tried the dispose method on the connection but even that doesn't do it. Does anyone know how to get ado.net objects to let go of a database?

Dim mConn As SqlClient.SqlConnection
mConn = New SqlClient.SqlConnection(psConnectionString)
Dim sSQL = "SELECT DBVersion FROM CLAwareInfo"
Dim Command As New SqlClient.SqlCommand(sSQL, mConn)
Dim sInstalledDBVersion As String

Command.Connection.Open()
Command.Connection.ChangeDatabase(psDatabase)
Try
sInstalledDBVersion = Command.ExecuteScalar()
Catch ex As Exception
sInstalledDBVersion = ""
Finally
Command.Connection.Close()
End Try

Thanks
David

GeneralRe: can't detach database Pin
Mike Dimmick7-Jul-04 11:31
Mike Dimmick7-Jul-04 11:31 
GeneralRe: can't detach database Pin
Grimolfr7-Jul-04 13:52
Grimolfr7-Jul-04 13:52 
GeneralStill doesn't work - more info Pin
dmbf1b57-Jul-04 16:49
dmbf1b57-Jul-04 16:49 
GeneralRe: Still doesn't work - more info Pin
Grimolfr8-Jul-04 5:28
Grimolfr8-Jul-04 5:28 
GeneralRe: Still doesn't work - more info Pin
dmbf1b58-Jul-04 9:19
dmbf1b58-Jul-04 9:19 
GeneraltSQL: Share -> Database Table (DTS?) Pin
partt7-Jul-04 5:19
partt7-Jul-04 5:19 
GeneralFinding the primary key Pin
Colin Angus Mackay7-Jul-04 4:45
Colin Angus Mackay7-Jul-04 4:45 
GeneralRe: Finding the primary key Pin
Mike Dimmick7-Jul-04 5:17
Mike Dimmick7-Jul-04 5:17 
GeneralRe: Finding the primary key Pin
Colin Angus Mackay7-Jul-04 5:28
Colin Angus Mackay7-Jul-04 5:28 
GeneralRe: Finding the primary key Pin
Grimolfr7-Jul-04 5:46
Grimolfr7-Jul-04 5:46 
GeneralRe: Finding the primary key Pin
Colin Angus Mackay7-Jul-04 6:01
Colin Angus Mackay7-Jul-04 6:01 
GeneralRe: Finding the primary key Pin
Grimolfr7-Jul-04 6:15
Grimolfr7-Jul-04 6:15 
GeneralCannot call Oracle stored procedure from C++ Pin
pankajdaga6-Jul-04 9:35
pankajdaga6-Jul-04 9:35 
GeneralRe: Cannot call Oracle stored procedure from C++ Pin
Chris Meech7-Jul-04 3:04
Chris Meech7-Jul-04 3:04 
GeneralADO.NET - BindingContext and Disappearing Rows Pin
mikasa6-Jul-04 8:54
mikasa6-Jul-04 8:54 
GeneralArabic to English Conversion Pin
Anonymous6-Jul-04 7:13
Anonymous6-Jul-04 7:13 
Generaloverwite/add between two databases help Pin
Anonymous6-Jul-04 3:51
Anonymous6-Jul-04 3:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.