Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Data.Sql
- Imports System.Data.SqlClient
- Module Module1
- Public koneksi As SqlConnection
- Public data As DataSet
- Public baca As SqlDataReader
- Public adaptor As SqlDataAdapter
- Public cmd As SqlCommand
- Public ass As DataTable
- Public sql As String
- Public Sub buka()
- sql = "Data Source=ADMIN-PC\SQLEXPRESS;Initial Catalog=dtoee;Persist Security Info=True;UID=sa;PWD=123456"
- koneksi = New SqlConnection(sql)
- Try
- If koneksi.State = ConnectionState.Closed Then
- koneksi.Open()
- End If
- Catch ex As Exception
- MsgBox(Err.Description, MsgBoxStyle.Critical, "Error")
- End Try
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement