![]() |
Database »
Database »
ADO.NET
Intermediate
WQL DataProvider for ADO.NETBy Maxim KazitovWQL DataProvider for ADO.NET |
Windows, .NET, Visual Studio, Dev
|
|
Advanced Search |
|
|
|
||||||||||||||||
SELECT, ASSOCIATORS and
REFERENCES queries. Doesn't support event queries.
using WQLData;
//.............
//.............
WQLConnection connection = new WQLConnection(
String.Format(@"Server:{0};User:{1\2};Password:{3}",
server, doamin, user, password));
DataSet dataSet = new DataSet("WQLDataSet");
WQLDataAdapter adapter = new WQLDataAdapter(
"SELECT * FROM Win32_LogicalDisk", WQLContext.Connection);
adapter.Fill(dataSet, "LogicalDisks");
//.............
//.............

Query :
SELECT __CLASS, __SUPERCLASS, __DYNASTY
FROM Meta_Class
WHERE __DYNASTY = "CIM_PhysicalCapacity"
Result :
| __CLASS | __SUPERCLASS | __DYNASTY |
| CIM_PhysicalCapacity | CIM_PhysicalCapacity | |
| CIM_MemoryCapacity | CIM_PhysicalCapacity | CIM_PhysicalCapacity |
Query :
SELECT DeviceID, FileSystem, Size, FreeSpace,
Compressed, Description, MediaType
FROM Win32_LogicalDisk
WHERE MediaType = 12
Result :
| DeviceID | FileSystem | Size | FreeSpace | Compressed | Description | MediaType |
| C: | NTFS | 12068872192 | 185409536 | False | Local Fixed Disk | 12 |
| D: | NTFS | 12068872192 | 185409536 | False | Local Fixed Disk | 12 |
| O: | NTFS | 12068872192 | 185409536 | False | Local Fixed Disk | 12 |
Analyzer also supports ASSOCIATORS and REFERENCES queries. For example :
ASSOCIATORS OF {Win32_LogicalDisk.DeviceID="C:"}
WHERE ClassDefsOnly
REFERENCES OF {Win32_NetworkAdapter.DeviceID="0"}
WHERE resultclass = Win32_NetworkAdapterSetting requiredQualifier = Dynamic
Note : Analyzer doesn't support Event queries
Current version support some extension (not supported in stantart
WQL)
Invoke method :
CALL [\\server\root\cimv2:Win32_Process.Handle="2236"].Terminate(Reason=0)
Update property :
UPDATE Win32_Environment
SET VariableValue = 'Hi2'
WHERE __PATH='\\EPNL007\root\cimv2:Win32_Environment.Name="Test",
UserName="server\\user"'
SELECT TOP :
SELECT TOP 50 __PATH, Logfile, RecordNumber, EventType,InsertionStrings,
Message, SourceName, TimeGenerated
FROM Win32_NTLogEvent
WHERE Logfile = 'Application'
Order By :
SELECT __PATH, Caption, ExecutablePath, CreationDate,KernelModeTime,
ProcessId, ParentProcessId, Priority, ThreadCount, VirtualSize
FROM Win32_Process
ORDER BY Caption ASC


| You must Sign In to use this message board. | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 1 Sep 2004 Editor: Nishant Sivakumar |
Copyright 2004 by Maxim Kazitov Everything else Copyright © CodeProject, 1999-2009 Web17 | Advertise on the Code Project |