Imports System.Data.SqlClient
Module SQL_Module
    Public ConString As String : Public SQL1 As String : Public conn As New SqlConnection : Public cmd As New SqlCommand : Public dr As SqlDataReader : Public da As New SqlDataAdapter
    Friend Sub ConnOpen()
        conn.Close() : If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
    End Sub
    Friend Sub CmdSet_For_DGV()
        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd
    End Sub
    Friend Sub CmdSet_For_dr()
        cmd.CommandText = SQL1 : cmd.Connection = conn : dr = cmd.ExecuteReader
    End Sub
End Module
