System.Data.DataTableCollection.CopyTo C# (CSharp) Méthode

CopyTo() public méthode

public CopyTo ( DataTable array, int index ) : void
array DataTable
index int
Résultat void
        public void CopyTo(DataTable[] array, int index)
        {
            if (array == null)
            {
                throw ExceptionBuilder.ArgumentNull(nameof(array));
            }
            if (index < 0)
            {
                throw ExceptionBuilder.ArgumentOutOfRange(nameof(index));
            }
            if (array.Length - index < _list.Count)
            {
                throw ExceptionBuilder.InvalidOffsetLength();
            }
            for (int i = 0; i < _list.Count; ++i)
            {
                array[index + i] = (DataTable)_list[i];
            }
        }