C# datatable get all column names into string array using (linq/predicate


SUBMITTED BY: Guest

DATE: Nov. 21, 2013, 5:31 a.m.

FORMAT: C#

SIZE: 161 Bytes

HITS: 876

  1. string[] columnNames = dt.Columns.Cast<DataColumn>()
  2. .Select(x => x.ColumnName)
  3. .ToArray();

comments powered by Disqus