Solved

MySQL How do I enumerate a list of servers

Posted on 2013-06-24
4
384 Views
Last Modified: 2013-06-25
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
0
Comment
Question by:Nashua58
  • 2
  • 2
4 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 39274049
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
 

Author Comment

by:Nashua58
ID: 39274460
Hi Sedgwick

I would really like just the client machine.

Thanks
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 39274466
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
 

Author Closing Comment

by:Nashua58
ID: 39276619
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

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now