Code to programatically check whether SQLServer2000 is installed in the machine

sureshcd10

Well-known member
Joined
Dec 25, 2003
Messages
77
hi,
How can I programatically check whether SQLServer2000 is installed in the machine.?If installed I want to check whether a Particular database name is there? How can I do this.Please send some VB6/vb.net/C#.net code for the same.
Thank u all
 
well personally i would just check for sql server registry keys being present on the machine to determine whether it is installed on the machine, then to check if a database is there - just try and connect to it, if it isnt there it will return an exception - so just handle that. (you could possibly do this to determine if SQL is on the machine too - but the fact it cant connect to a database doesnt necessarily mean that SQL server isnt running.)
 
Back
Top