I make a database in VS and it doesn’t work so I delete it and try again but I get an error
“An attempt to attach an auto-named database for file C:\db.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.”
I thought when I clicked delete it deleted it.
It sounds like you are going to the folder and deleting the database, maybe try doing it through programming in a Try_Catch statement. I found this on Microsoft’s website. That you can try.
http://msdn.microsoft.com/en-us/library/ms171854.aspx
You may also want to make sure the file path in the program is the actual file path you are deleting and that the database is not opened or in use by other applications.
It could also be that the cache is not getting refreshed when you delete the database, try manually refreshing the cache. I had to do this while working on some hw assignments a few months ago. Here’s an article that speaks to that:
http://connectsql.blogspot.com/2011/02/intellisense-in-sql-server-2008-is-time.html
Hope it helps.