Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Cannot create new database when .MDF file is deleted

$
0
0
I am using SQL Express. In a nutshell, during some testing of DLINQ; I create a DB just fine, mess around with it - No Problems. Close the DB and exit the AppDomain/Process.

Then I delete the. MDF and .LDF files and hope to repeat the process.

 When I try to do anything (CreateDatabase() or DeleteDatabase()  ) using the same filename, it throws an exception stating that the file already exists (when it clearly does not). If I change the filename (by adding "1" to the end, for instance) it works fine right up until I  delete the new file (the one with the new name)

There must be some "feature" that make deleting those files a no-no... How should I be doing this?

 Thanks!

Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>