views:

112

answers:

1

In normal condition, I can add schemas in the dbml file to empty database with code below.

But now when I run this code, I take the error "Cannot drop database "test" because it is currently in use." How can I do it?

Dim db As New UI_Class.UIData
        If db.DatabaseExists Then
            db.DeleteDatabase()
        End If

    db.CreateDatabase()
A: 

It might happen as your SQL Server Management Studio (SSMS) must be holding it.

simplyharsh
No! SSMS was closed during this proccess
mavera