Advertisement
binjeeclick

module

Nov 25th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.65 KB | None | 0 0
  1. Imports MySql.Data.MySqlClient
  2.  
  3. Module ModuleKoneksiMySQL
  4.  
  5.     Public conn As MySqlConnection
  6.     Public cmd As MySqlCommand
  7.     Public rd As MySqlDataReader
  8.     Public da As MySqlDataAdapter
  9.     Public ds As DataSet
  10.     Public str As String
  11.  
  12.     Sub koneksi()
  13.  
  14.         Try
  15.  
  16.             Dim str As String = "Server=localhost;user id=root;password=marlboro;database=sekolah"
  17.  
  18.             conn = New MySqlConnection(str)
  19.  
  20.             If conn.State = ConnectionState.Closed Then
  21.  
  22.                 conn.Open()
  23.  
  24.             End If
  25.  
  26.         Catch ex As Exception
  27.             MessageBox.Show(ex.Message)
  28.         End Try
  29.     End Sub
  30.  
  31. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement