ADO.Net - DataView

A data view is like a table, but with a few extra capabilities - like filtering and sorting.

Sample

1
2
3
4
5
6
7
8
9
Dim sz As String _
= "select * from fs_tbl_meter_inspection "

Dim ds As DataSet _
= si_db_access.DS_Fetch(sz, "FieldSystem_ConnectionString", _
Maxcount:=10000)

Dim dv As DataView _
= New DataView(ds.Tables(0))

But you can setup in-memory filters

1
dv.RowFilter = "stName='" & txtFilter.Text & "'"

And in-memory sorts

1
dv.Sort = 'STNO'
  • limitation of the Sort method - you cannot use logic (ex case when …) just fields and ASC, DESC

To access data, you would use a command that looks something like the following

1
>? dv(0)("html_Launch").tostring