hi!!
im a new to vb.net and im having a problem, pls help me
ok here it is...
i created a listview, and i have a button5 "view records"
if i click the button, all the records should be shown to the listview but yeah i doesn't work
here are may codes:
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
conn = New OleDbConnection("Provider = Microsoft.ace.oledb.12.0; data source=|DataDirectory|\AutomatedLibrarySystem.accdb")
conn.Open()
str = "select * from BookInfo"
com = New OleDbCommand(str, conn)
oledbda = New OleDbDataAdapter(com)
ds = New DataSet
oledbda.Fill(ds, "BookInfo")
ListView1.Clear()
dt = ds.Tables("BookInfo")
Dim i As Integer
For i = 0 To dt.Rows.Count - 1
ListView1.Items.Add(dt.Rows(i).ItemArray(1))
ListView1.Items(i).SubItems.Add(dt.Rows(i).ItemArray(2))
ListView1.Items(i).SubItems.Add(dt.Rows(i).ItemArray(3))
ListView1.Items(i).SubItems.Add(dt.Rows(i).ItemArray(4))
ListView1.Items(i).SubItems.Add(dt.Rows(i).ItemArray(5))
ListView1.Items(i).SubItems.Add(dt.Rows(i).ItemArray(6))
ListView1.Items(i).SubItems.Add(dt.Rows(i).ItemArray(7))
ListView1.Items(i).SubItems.Add(dt.Rows(i).ItemArray(8))
ListView1.Items(i).SubItems.Add(dt.Rows(i).ItemArray(9))
ListView1.Items(i).SubItems.Add(dt.Rows(i).ItemArray(10))
Next
conn.Close()
End Sub
thank you =D