Advertisement
PlajariKode

Class Database

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