Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

RelatedObjectQuery.RelationshipClass Property

Gets or sets the type of relationship (association).

[Visual Basic]
Public Property RelationshipClass As String
[C#]
public string RelationshipClass {get; set;}
[C++]
public: __property String* get_RelationshipClass();
public: __property void set_RelationshipClass(String*);
[JScript]
public function get RelationshipClass() : String;
public function set RelationshipClass(String);

Property Value

A string containing the relationship class name.

Remarks

Setting this property value overrides any previous value stored in the object. The query string is rebuilt to reflect the new relationship class.

Example

[Visual Basic, C#] For example, for finding all the Win32 services dependent on a service, this property should be set to the "Win32_DependentService" association class:

[C#] 
RelatedObjectQuery q = new RelatedObjectQuery("Win32_Service='TCP/IP'");
q.RelationshipClass = "Win32_DependentService";
   
[Visual Basic] 
Dim q As New RelatedObjectQuery("Win32_Service=""TCP/IP""")
q.RelationshipClass = "Win32_DependentService"
   

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

RelatedObjectQuery Class | RelatedObjectQuery Members | System.Management Namespace

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.