1. Siapkan file database yang ingin ditampilkan di vb.
2. Design :
3. coding pada DataGridView (menyesuaikan)
Imports System.Data.OleDb
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Using Conn As New OleDbConnection(ConnStr)
Using Dta As New OleDbDataAdapter("Select * from 2R2", Conn)
Conn.Open()
Dim dttabel As New DataTable
Dta.Fill(dttabel)
DataGridView1.DataSource = dttabel
End Using
End Using
End Sub
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
End Sub
End Class
4. Buat Module Baru (project - Add Modules)
coding (menyesuaikan) :
Module Module_TEMAN_XIR2
Public ConnStr As String = "Provider=Microsoft.ACE.oledb.12.0;" & _
"Data Source= D:\TEMANXIR2.accdb"
End Module
0 komentar:
Posting Komentar