편집

다음을 통해 공유


DataBinder.GetPropertyValue Method

Definition

Retrieves the value of a property.

Overloads

GetPropertyValue(Object, String)

Retrieves the value of the specified property of the specified object.

GetPropertyValue(Object, String, String)

Retrieves the value of the specified property of the specified object, and then formats the results.

GetPropertyValue(Object, String)

Retrieves the value of the specified property of the specified object.

public:
 static System::Object ^ GetPropertyValue(System::Object ^ container, System::String ^ propName);
public static object GetPropertyValue (object container, string propName);
static member GetPropertyValue : obj * string -> obj
Public Shared Function GetPropertyValue (container As Object, propName As String) As Object

Parameters

container
Object

The object that contains the property.

propName
String

The name of the property that contains the value to retrieve.

Returns

The value of the specified property.

Exceptions

container is null.

-or-

propName is null or an empty string ("").

The object in container does not have the property specified by propName.

Examples

The example for DataBinder demonstrates the use of this method.

Remarks

The GetPropertyValue method is used to retrieve the value of a property in an object.

Applies to

GetPropertyValue(Object, String, String)

Retrieves the value of the specified property of the specified object, and then formats the results.

public:
 static System::String ^ GetPropertyValue(System::Object ^ container, System::String ^ propName, System::String ^ format);
public static string GetPropertyValue (object container, string propName, string format);
static member GetPropertyValue : obj * string * string -> string
Public Shared Function GetPropertyValue (container As Object, propName As String, format As String) As String

Parameters

container
Object

The object that contains the property.

propName
String

The name of the property that contains the value to retrieve.

format
String

A string that specifies the format in which to display the results.

Returns

The value of the specified property in the format specified by format.

Exceptions

container is null.

-or-

propName is null or an empty string ("").

The object in container does not have the property specified by propName.

Examples

The example for DataBinder demonstrates the use of this method.

Remarks

This version of the GetPropertyValue method is used to retrieve and format the value of a property in an object.

Applies to