dataBase.Select.CopyToDataTable().DefaultView.ToTable(False, “Asset IP Address”,“Asset Names”,“Asset OS Name”)

i have many questions about 1) and 2)the method DefaultView,i searched in,but can’t understand.
can anyone provide some examples.Thank you great!

Hi @chen,

To understand about,refer the below link.

Hey @chen

Datatable Select:

DataTable has a Select method.It Gets an array of all DataRow objects that match the filter criteria, in the specified sort order.


Type: - System.String
The criteria to use to filter the rows. For examples on how to filter rows, see DataView RowFilter Syntax [C#].

Type:- System.String
A string specifying the column and sort direction.

Datatable Default View:-

Gets a customized view of the table that may include a filtered view, or a cursor position.

The DefaultView has the advantage of being there already by default, as the name implies.

The DefaultView property returns a DataView you can use to sort, filter, and search a DataTable.


1 Like