FJ,
this works for me
***************************************************
Public Sub FillListView(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Dim iID As Integer
Dim i As Integer
Dim oListViewItem As ListViewItem
If moDataset.Tables.Count <> 0 Then
For i = 0 To moDataset.Tables.Item(0).Rows.Count - 1
If iID <> CType(moDataset.Tables.Item(0).Rows.Item(i)("PLANNING_ID"),
Integer) Then
oListViewItem = New
ListViewItem(CType(moDataset.Tables.Item(0).Rows.Item(i)("PLANNING_ID"),
String))
oListViewItem.SubItems.Add(CType(moDataset.Tables.Item(0).Rows.Item(i)("BART
EXT"), String))
oListViewItem.SubItems.Add(CType(moDataset.Tables.Item(0).Rows.Item(i)("STAR
TTIJD_GEPLAND"), String))
oListViewItem.SubItems.Add(CType(moDataset.Tables.Item(0).Rows.Item(i)("EIND
TIJD_GEPLAND"), String))
Me.lstPlanning.Items.Add(oListViewItem)
iID = CType(moDataset.Tables.Item(0).Rows.Item(i)("PLANNING_ID"), Integer)
oListViewItem = Nothing
End If
Next
Me.lstPlanning.Items.Item(0).Selected = True
Me.UpdateStatus("Planning loaded.")
Else
Me.UpdateStatus("No planning found.")
End If
Cursor.Current = Cursors.Default
End Sub
***************************************************
Marc
FJ said:
hi everyone!
does anyone know how to bind a listview to a table so that it displays the result of a particular query?
I tried using a reader but it does not work. This is the first time am
using a listview so please help!!!