ToDictionary¶
Returns a DataTableDictionary indexed by the specified columns for fast access.
myDataTable.ToDictionary(columns: string, separator?: string):DataTableDictionary (DataTableDictionary)
Parameters¶
string columns
A comma-separated or semicolon-separated string of column names to use as the key. If not specified, an error is thrown.
string separator optional
The separator to use for the dictionary key when multiple columns are specified. If not specified, a "." (dot) is used by default.
Returns¶
A DataTableDictionary instance.
Remarks¶
When the columns argument contains an invalid column that is not in the DataTable, an error is thrown.
If multiple rows share the same key, the dictionary value will be an array of data table rows.
Convert users to a dictionary¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
Using multiple columns¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |