KOD: Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load spojeni.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=telefon11.accdb" Dim dotaz As String dotaz = "select* from Telefony" Dim SQLprikaz As New OleDb.OleDbCommand(dotaz, spojeni) spojeni.Open() Try Dim vysledekdotazu As OleDb.OleDbDataReader = SQLprikaz.ExecuteReader Do While vysledekdotazu.Read Dim polozka As New ListViewItem polozka.Text = vysledekdotazu("ID").ToString polozka.SubItems.Add(vysledekdotazu("Typ").ToString) ListView1.Items.Add(polozka) Loop Catch ex As Exception MsgBox(ex.Message) End Try spojeni.Close() End Sub End Class
|