So please lets go:
Imports System.Data.SqlClient
Module Module1
Public sttr1 As String
Public dbconc As SqlConnection
Public dbrec As SqlCommand
Public Sub connect()
sttr1 = "Data Source=localhost;Initial Catalog=Moto;Integrated Security=True"
dbconc = New SqlClient.SqlConnection(sttr1)
dbrec = New SqlClient.SqlCommand()
dbrec.Connection = dbconc
dbconc.Open()
End Sub
Public Sub disconnect()
dbconc.Close()
End Sub
End Module
This code works 100%. I generally use it and made a lot of projects with that. For this reason, try with it. If you find any bug here or you get a better then please share it. Thanks for reading this post.
0 comments:
Post a Comment