MySQL How do I enumerate a list of servers

I have to convert a VB 2010 application from SQL Server to MySQL. One thin this program does the first time it run is to check for a SQL installation. If it does not fine one it then installs SQL Server. I need that to happen with MySQL, So my question is what is the MySQL equivalent to System.Data.Sql.SqlDataSourceEnumerator.Instance.GetDataSources.

Thanks
Art
Nashua58Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Meir RivkinConnect With a Mentor Full stack Software EngineerCommented:
string query = "SELECT * FROM Win32_Product WHERE Name LIKE '%MySQL%'";

            var s = new ManagementObjectSearcher("root\\CIMV2", query);
            foreach (ManagementObject service in s.Get())
            {
                // show the instance 
                Console.WriteLine(service.ToString());

            } 

Open in new window

0
 
Meir RivkinFull stack Software EngineerCommented:
GetDataSources return visible SQL Server instances in the whole network, do u want to do the same with MySql?
or just look for the client machine and if no instance is running then install MySql?
0
 
Nashua58Author Commented:
Hi Sedgwick

I would really like just the client machine.

Thanks
0
 
Nashua58Author Commented:
Thank you so much this is just what I was looking for. Out of curiosity how would you accomplish this if you were looking over the entire network?

Art
0
All Courses

From novice to tech pro — start learning today.