asp.net.ph

Array.SetValue Method ( Object, Int32 )

System Namespace   Array Class


Sets a value to the element at the specified position in the one-dimensional Array.

[ VB ]
<Serializable>
Overloads Public Sub SetValue ( _
   ByVal value As Object, _
   ByVal index As Integer _
)

[ C# ]
[Serializable]
public void SetValue (
   object value,
   int index
);

[ C++ ]
[Serializable]
public: void SetValue (
   Object* value,
   int index
);

[JScript ]
public Serializable
function SetValue (
   value : Object,
   index : int
);

Parameters

value
The new value for the specified element.
index
The position of the Array element to set.

Exceptions


Exception Type Condition
ArgumentException The current Array does not have exactly one dimension.

-or-

value does not contain a type that can be widened, using the standard widening conversions, to the element type of the current Array.

IndexOutOfRangeException index is outside the range of valid indexes for the current Array.

Remarks

The GetLowerBound and GetUpperBound methods can determine whether the value of index is out of bounds.

For more information about conversions, see Convert.

See Also

Array Members   Array.SetValue Overload List   GetLowerBound   GetUpperBound   GetValue Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph