pastikan agan sudah menginstal visual studio dan xampp.
tambahkan referensi MySQL.Data di References
buat dulu form designnya seperti pada gambar dibawah ini
source code nya
Imports MySql.Data.MySqlClient
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim MySQLConnection As New MySqlConnection("host=127.0.0.1; user=root;database=sia_sekolahdb ")
Try
MySQLConnection.Open()
MessageBox.Show("terhubung gan")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
End Class
jika sudah berhasil terkoneksi , tampilannya begini gan
ini video tutorialnya gan
0 comments:
Post a Comment