Imports System.Data.OleDb
Public Class frm_container
'Public connString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=db.accdb"
Dim conn As New OleDbConnection
Dim myqry As String = Nothing
Dim mycmd As New OleDbCommand
Dim mydr As OleDbDataReader
Dim str As String = Nothing
Private Sub frm_container_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call LVsettings()
Call ConnToDB()
Call FillListview()
Call Set1()
End Sub
#Region "FillListView"
Sub FillListview()
LV.Items.Clear()
myqry = "SELECT * from Container ORDER BY ID_Container ASC"
mycmd = New OleDbCommand(myqry, conn)
mydr = mycmd.ExecuteReader
While mydr.Read
With LV
.Items.Add(mydr("ID_Container"))
With .Items(.Items.Count - 1).SubItems
.Add(mydr("Container_Name"))
.Add(mydr("Container_Status"))
End With
End With
End While
End Sub
End Class