Public Sub koneksi() Try str = "Server=localhost;uid=root;pwd=1705;database=penjualan" conn = New MySqlConnection(str) If conn.State = ConnectionState.Closed Then conn.Open() MsgBox("Koneksi berhasil") End If Catch ex As Exception 'MsgBox("Koneksi gagal" + ex.Message) End Try End Sub
Public Sub koneksi() Try str = "Server=localhost;uid=root;pwd=1705;database=penjualan" conn = New MySqlConnection(str) If conn.State = ConnectionState.Closed Then conn.Open() MsgBox("Koneksi berhasil") End If Catch ex As Exception 'MsgBox("Koneksi gagal" + ex.Message) End Try End Sub