dataBase.Select.CopyToDataTable().DefaultView.ToTable(False, “Asset IP Address”,“Asset Names”,“Asset OS Name”)
i have many questions about 1)database.select and 2)the method DefaultView,i searched in vb.net,but can’t understand.
can anyone provide some examples.Thank you great!
To understand about Database.select,refer the below link.
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#].
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.