C# to check if SQL server installed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chloe Heaven
    New Member
    • Oct 2011
    • 2

    #1

    C# to check if SQL server installed

    I would like a C# sharp code to check if Microsoft SQL Server 05 or 08 is installed and then show as a result yes or no. I have seen that i can go through the registry but i am not certain as to the code...if there are other options i wouldnt mind either. thanks in advance for any help
  • GaryTexmo
    Recognized Expert Top Contributor
    • Jul 2009
    • 1501

    #2
    Have a look here...

    http://msdn.microsoft.com/en-us/libr...gistrykey.aspx

    You can use the RegistryKey class to work with the windows registry. Use the OpenSubKey method to open the key you want and then you can read the values stored there.

    If you are going to do this, you need to make sure your program is running with administrator access. You might need to look into UAC stuff.

    Comment

    Working...