Código
Public Function conexion() As Oracle.DataAccess.Client.OracleConnection Try 'Dim objeto As New GlobalIdentity user = GlobalIdentity.Instance.User pass = GlobalIdentity.Instance.Password If String.IsNullOrEmpty(user) Or String.IsNullOrEmpty(pass) Then Throw New Exception("Usuario y Password son requeridos") End If Dim conn As String = ConfigurationManager.ConnectionStrings("Principal").ConnectionString conn = String.Format(conn, user, pass) Dim cn As New OracleConnection() cn.ConnectionString = conn Return cn Catch ex As OracleException Throw New ArgumentException("Error en la Conexion" & ex.ToString) End Try End Function