Ok, I'm trying to detach a SQL database though VB code. However, to do this I need to connect to SQL server. But I can't connect to my softwares database because then I won't be able to detach a database that's in use. So I need to connect to SQL servers default Master Database.
The problem is that the user may have installed SQL server in a directory other then the default specified path. So before I can connect to the database, I need to figure out where it is (the Master.mdf file path) all through Visual Basic.
I don't need the code, but more of the location of such information. I searched the registry but couldn't find anything. Is it in the registry and I just missed it? Any other ideas?