Assigns a value to the element at the specified position in the two-dimensional Array.
[Visual Basic] Overloads Public Sub SetValue( _ ByVal value As Object, _ ByVal index1 As Integer, _ ByVal index2 As Integer _ ) [C#] public void SetValue( object value, int index1, int index2 ); [C++] public: void SetValue( Object* value, int index1, int index2 ); [JScript] public function SetValue( value : Object, index1 : int, index2 : int );
None.
Exception Type | Condition |
---|---|
ArgumentException | The Array does not have exactly two dimensions.
-or- value does not contain a type that can be widened, using the standard widening conversions, to the element type of the Array. |
IndexOutOfRangeException | index1 or index2 is outside the range of valid indices for the corresponding dimension of the Array. |
The GetLowerBound and GetUpperBound methods can be used to determine whether any of the indices is out of bounds.
Array Class | Array Members | System Namespace | Array.SetValue Overload List | GetLowerBound | GetUpperBound | GetValue