Imports System.Data.SqlClient
Imports System.Configuration

Public Class Conexion


    Public Function Conectar() As SqlConnection
        Dim conexion As SqlConnection
        Dim vSQLServer As String
        Dim vUsuario As String
        Dim vClaveSQL As String
        Dim vBD As String

        vSQLServer = My.Settings.ServidorSQL
        vUsuario = My.Settings.UsuarioSQL
        vClaveSQL = My.Settings.ClaveSQL
        vBD = My.Settings.BaseDeDatos


        'conexion = New SqlConnection(ConfigurationManager.ConnectionStrings("cnInversiones").ConnectionString)
        Conexion = New SqlConnection("Data Source=" & vSQLServer & ";Initial Catalog=" & vBD & ";Persist Security Info=True;User ID=" & vUsuario & ";Password=" & vClaveSQL & ";Connect Timeout=30;ApplicationIntent=ReadOnly;MultipleActiveResultSets=true;")
        Return Conexion
    End Function
End Class
