Array.SetValue Method (Object, Int32)
Sets a value to the element at the specified position in the multidimensional Array. The indexes are specified as an array of 32-bit integers.
Assembly: mscorlib (in mscorlib.dll)
indices is a null reference (Nothing in Visual Basic).
The number of dimensions in the current Array is not equal to the number of elements in indices.
value cannot be cast to the element type of the current Array.
Any element in indices is outside the range of valid indexes for the corresponding dimension of the current Array.
The number of elements in indices must equal the number of dimensions in the Array. All elements in the indices array must collectively specify the position of the desired element in the multidimensional Array.
For more information about conversions, see Convert.
This method is an O(1) operation.
If SetValue is used to assign a null reference (Nothing in Visual Basic) 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.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.