Advertisement
ferdhika31

Koneksi MySQL

Jan 15th, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.52 KB | None | 0 0
  1. Imports MySql.Data.MySqlClient
  2. Public Class Form1
  3.     Public koneksi As New MySqlConnection
  4.     Dim perintah As MySqlCommand
  5.  
  6.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  7.         Try
  8.             koneksi.ConnectionString = "server=localhost;uid=root;database=db_ferdhikaa;"
  9.             koneksi.Open()
  10.             MsgBox("Tersambung")
  11.         Catch ex As Exception
  12.             MsgBox("Tidak terhubung")
  13.             End
  14.         End Try
  15.     End Sub
  16. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement