DataTable removes repeated values from the column
DataTable dtPCI = dtblSourceData. DefaultView. ToTable (true, new string [] {"Server Cell PCI "});
Create and return a new able Based on the rows in the existing DataView.
Namespace:System. Data
Assembly:System. Data (in System. Data. dll) parameter
-
TableName
-
Type: System. String
The name of the returned DataTable.
-
Distinct
-
Type: System. Boolean
If true, the returned DataTable will contain rows with different values for all columns. The default value is false.
-
ColumnNames
-
Type: System. String []
A string array that contains the list of column names to be included in the returned DataTable. DataTable contains the specified columns in the same order as these columns in the array.
Return Value Type: System. Data. DataTable
A new able instance contains the requested rows and columns. Note: If you must retrieve different values from the subsets of available columns, use this overload version of The ToTable method to specify a new name for the returned DataTable. If you do not need a subset of different rows or columns, see ToTable.