Professional Documents
Culture Documents
PP
PP
PP
Imports System.Data
Imports System.Data.OleDb
Public Class Form1
Dim oConn As New OleDbConnection
Dim oComm As New OleDbCommand
Dim oDR As OleDbDataReader
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.Even
tArgs) Handles MyBase.Load
oConn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=
C:\Users\gsule\Desktop\Dummy.accdb"
oComm.Connection = oConn
oComm.CommandText = "SELECT * FROM Genero"
oConn.Open()
oDR = oComm.ExecuteReader
While oDR.Read
ListBox1.Items.Add(oDR("Tipo"))
End While
oDR.Close()
oConn.Close()
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByV
al e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
MessageBox.Show(ListBox1.SelectedItem.ToString)
End Sub
Private Sub MonthCalendar1_DateChanged(ByVal sender As System.Object, ByVal
e As System.Windows.Forms.DateRangeEventArgs) Handles MonthCalendar1.DateChanged
MessageBox.Show(MonthCalendar1.SelectionStart.ToShortDateString)
End Sub
End Class