ArrayCreateInstance Method (Type, Int32, Int32) |
Creates a two-dimensional
Array of the specified
Type and dimension lengths, with zero-based indexing.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static Array CreateInstance(
Type elementType,
int length1,
int length2
)
Parameters
- elementType
- Type: SystemType
The Type of the Array to create. - length1
- Type: SystemInt32
The size of the first dimension of the Array to create. - length2
- Type: SystemInt32
The size of the second dimension of the Array to create.
Return Value
Type:
ArrayA new two-dimensional
Array of the specified
Type with the specified length for each dimension, using zero-based indexing.
Exceptions Exception | Condition |
---|
ArgumentNullException | elementType is null. |
ArgumentException | elementType is not a valid Type. |
NotSupportedException | elementType is not supported. For example, Void is not supported. -or-elementType is an open generic type. |
ArgumentOutOfRangeException | length1 is less than zero.-or-length2 is less than zero. |
See Also