Sets a value to the element at the specified position in the two-dimensional Array. The indexes are specified as 32-bit integers.
Type Reason ArgumentException The current instance does not have exactly two dimensions. IndexOutOfRangeException At least one of index1 or index2 is outside the range of valid indices for the corresponding dimension of the current instance. InvalidCastException value is not assignment-compatible with the element type of the current instance.
The Array.GetLowerBound(int) and Array.GetUpperBound(int) methods can determine whether any of the indexes is out of bounds.
For more information about conversions, see Convert.
This method is an O(1) operation.
If erload:System.Array.SetValue is used to assign null to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference.