how can i check whether sql server 2008 is installed or not in C# .net window application ??

i am creating window application , in my application i want to check whether sql server 2008 is installed or not (when my application start) ??

and if sql server 2008 is not installed in my system then it will give appropriate message , but how can i do this ?
Who is Participating?

Improve company productivity with a Business Account.Sign Up

rawinnlnx9Connect With a Mentor Commented:

The above has many different examples and I bet the registry check should work fine for you.
Parth48Author Commented:
i want to check it when my application start and check it through C# coding ....
You have to choices from my point of view.
One is searching in windows registry.  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\100.
Another choice, more complex maybe, is adding a launch condition to your msi installation, in case you have one.

Best regards.
Parth48Author Commented:
hi @rawinnlnx9:-

i got the below error , what can i do ?

"The type 'Microsoft.SqlServer.Management.Common.IAlterable' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.SqlServer.ConnectionInfo, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91'."
Parth48Author Commented:
where i can download Microsoft.SqlServer.Management.Common dll ??
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.