Podria usarlo de esta forma, Usando un Funcion Tambien pasando solo los parametros a la Funcion
Function Verifica(ByVal Usuario As String, ByVal Pass As String, ByVal Permiso As String)
Dim SQL As Conexion.Settings = New Conexion.Settings
Dim sqlcon As New SqlConnection("Data Source=Nombre_servidor;Initial Catalog=Nombre_DB;Integrated Security=True")
If sqlcon.State = ConnectionState.Closed Then sqlcon.Open()
Dim Consulta As String = "select * from [Table_Usuarios] where (Login_Usuario=@user) and (Contrasena=@password) and (Permisos=@Permisos)"
Dim comando As New SqlCommand(Consulta, sqlcon)
comando.CommandType = CommandType.Text
comando.Parameters.AddWithValue("@user", Usuario.Trim)
comando.Parameters.AddWithValue("@password", Pass.Trim)
comando.Parameters.AddWithValue("@Permisos", Permiso.Trim)
Try
comando.ExecuteScalar()
If comando.ExecuteScalar <> "" Then
Principal.Opacity = 100
Principal.Show()
Me.Close()
Else
MessageBox.Show("Usuario o Contraseña Incorrectos")
End If
Catch ErrorCapturado As Exception
MessageBox.Show("Error en Sistema: " + ErrorCapturado.ToString)
End Try
Return 0
End Function
Modo de Aplicacion Private Sub btnAceptar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancelar.Click
Verifica(txtusuario.Text, PasswordTextBox.Text, ComboBox1.Text)
End Sub
Por si te sirve aun o a alguien mas le sirve