Advertisement
Guest User

Module_koneksi

a guest
Oct 2nd, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports MySql.Data.MySqlClient
  2. Module Module_Koneksi
  3.     Public conn As MySqlConnection
  4.     Public cmd As MySqlCommand
  5.     Public rd As MySqlDataReader
  6.     Public da As MySqlDataAdapter
  7.     Public ds As DataSet
  8.     Public str As String
  9.  
  10.     Sub Connection()
  11.         Try
  12.             Dim str As String = "Server=localhost;user id=root;password=;database=db_penjualan"
  13.             conn = New MySqlConnection(str)
  14.             If conn.State = ConnectionState.Closed Then
  15.                 conn.Open()
  16.             End If
  17.         Catch ex As Exception
  18.             MessageBox.Show(ex.Message)
  19.         End Try
  20.     End Sub
  21.  
  22. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement