My C# .NET 2.0 application performs two queries using the ManagementObjectSearcher
class:
_searcher = new ManagementObjectSearcher("root\\WMI", "SELECT * FROM MSWmi_PnPInstanceNames");
_searcher = new ManagementObjectSearcher("root\\WMI", "SELECT * FROM MSSerial_PortName");
I would like to combine them, so that _searcher
contains all the results from both queries. However, when I try to do this...
_searcher = new ManagementObjectSearcher("root\\WMI", "SELECT * FROM MSWmi_PnPInstanceNames AND MSSerial_PortName");
...an "Invalid query" exception is thrown. Does anyone have any ideas as to how I can make this work? Thanks.