Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FieldInfo.SetValueDirect Method

Sets the value of the field supported by the given object.

This method is not CLS-compliant. The CLS-compliant alternative is the SetValue member. For more information about CLS compliance, see What is the Common Language Specification.

[Visual Basic]
<CLSCompliant(False)>
Public Overridable Sub SetValueDirect( _
   ByVal obj As TypedReference, _
   ByVal value As Object _
)
[C#]
[CLSCompliant(false)]
public virtual void SetValueDirect(
 TypedReference obj,
 object value
);
[C++]
[CLSCompliant(false)]
public: virtual void SetValueDirect(
 TypedReference obj,
 Object* value
);
[JScript]
public
   CLSCompliant(false)
function SetValueDirect(
 obj : TypedReference,
 value : Object
);

Parameters

obj
A managed pointer to a location and a runtime representation of the type that can be stored at that location.
value
The value to assign to the field.

Exceptions

Exception Type Condition
NotSupportedException The caller requires the CLS alternative, but called this method instead.

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

FieldInfo Class | FieldInfo Members | System.Reflection Namespace

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft