I had a windows application, it will connect to online database if network is available.
and connect to local database if no network is available.
So application requires SQL Server in client machine, for offline data storage.
In setup creation, if I specify the prerequisite as SQL Server 2005 Express, then setup will check for SQL Server 2005 Express only. It won’t check for full version is installed or not.
Now my problem is..
If the client computer has one or more instance(s) of SQL Server installed already (i.e SQL Server 2008 Express or a full version i.e. Enterprise/Standerd/Developer edition) for the user, an option needs to be shown to choose the instance on which application has to store data for offline usage.
- Is there any way to specify OR criteria for SQL Server in the prerequisite as if any of the instance exists??
- if more than one instance or version exists, it need to show all available SQL Server instances on this machine.. but I am not getting all instances.
I am using the following code to detect SQL Server instances,
ManagedComputer mc = new ManagedComputer();
foreach (ServerInstance si in mc.ServerInstances)
{
liServers.Add(si.Name);
}
Please help me..
Thanks
Ramanji.
try this method from MSDN