privatevoid 24 Junior Poster in Training

I have a small WMI issue that I am having trouble with.

I am using root\WMI:MSSerial but would like to retrieve properties from both MSSerial_PortName and MSSerial_CommInfo specifically the following properties PortName, IsBusy and Active. If I query just one object then the code below works fine but I can't seem to work out how to combine the query.

// This Works
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\WMI", "SELECT InstanceName, Active, IsBusy FROM MSSerial_CommInfo");
            
foreach (ManagementObject mObject in searcher.Get())
{
    this.updateDisplay(String.Format("Active: {0}\nBusy{1}", mObject["Active"],mObject["IsBusy"]));
}

// This Doesn't Work
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\WMI", String.Format("SELECT PortName FROM MSSerial_PortName WHERE InstanceName = '{0}'", instanceName));

// I also tried a number of joins and where clauses to achive a similar result but to no avail.

Currently I have this working by creating two seperate tables for MSSerial_PortName and MSSerial_CommInfo and manually linking the results. I am sure there must be a better way of doing this!?