I am writing a code that filters the listview data between two selected dates. The code is not working, i am not finding a way to make it work in a listview, although it works on a datagrid.
listavalor.Items.Clear()
Dim dt As New DataTable
Dim ds As New DataSet
ds.Tables.Add(dt)
Dim coiso As New MySqlCommand("SELECT * FROM custospessoais WHERE CUS_DATA BETWEEN '" &
Format(datapicker1.Value, "dd-MM-yyyy") & "' AND '" &
Format(datapicker2.Value, "dd-MM-yyyy") & "' CUS_ID;")
Dim da As New MySqlDataAdapter(coiso)
da.Fill(dt)
Dim coluna As DataRow
For Each coluna In dt.Rows
listavalor.Items.Add(coluna.Item(0))
listavalor.Items(listavalor.Items.Count - 1).SubItems.Add(coluna.Item(1))
listavalor.Items(listavalor.Items.Count - 1).SubItems.Add(coluna.Item(2))
listavalor.Items(listavalor.Items.Count - 1).SubItems.Add(coluna.Item(3))
Next
See also: MySQL Data Types