Advertisement
PlajariKode

Class Database

Oct 5th, 2019
2,256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.51 KB | None | 0 0
  1. Imports System.Data.SqlClient
  2. Public Class Database
  3.     Public cmd As SqlCommand
  4.     Public query As String
  5.     Public konek As SqlConnection
  6.  
  7.     Public Sub koneksi()
  8.         Try
  9.             konek = New SqlConnection("data source = KK-PC\MSSQLSERVER1; initial catalog = crud; integrated security = true")
  10.             konek.Open()
  11.             'MsgBox("koneksi berhasil :)") atau dihapus
  12.         Catch ex As Exception
  13.             MsgBox("Koneksi gagal! : " + ex.Message)
  14.         End Try
  15.     End Sub
  16. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement