Datatable.select


#1

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!


#2

Hi @chen,

To understand about Database.select,refer the below link.


#3

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.

Parameters

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

sort
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.

Regards,!!
Aksh