What is the way to find out if,
- there is a locally running instance of SQL Server
- if so, does database X exist?
- if so, can databse X be connected to using integrated security?
I want to accomplish the above at application startup in the cleanest possible way. Specficially, I'm worried about introducing the kind of delay I commonly see when I click on a dropdown to browse for databses in a connection wizard of various dev tools.
I can make the assumption of the instance name being either .
or .\sqlexpress
.
The end users are mostly running Windows XP.
The actual context of this is I want to automatically have my application sense a local database that developers can have installed.
If it's as simple as creating a a SqlConnection with the apprpriate values in the connection string, and that is what is safe and the recommended way, then I'm good with that. I'm asking this because I'm trying to be safe about not introducing a bad end user experience.