Ver Mensaje Individual
  #10 (permalink)  
Antiguo 06/02/2010, 14:55
igonfil
 
Fecha de Ingreso: junio-2008
Mensajes: 250
Antigüedad: 16 años, 9 meses
Puntos: 1
Respuesta: Problema con la tabla dinámica

en una clase externa tengo la conexión

Código PHP:
Public Class Cconexion
    
'Public resultado As Integer
    '
Public Function suma(ByVal x As IntegerByVal y As Integer)

    
'    resultado = x + y
    '    
Return resultado
    End 
Function
    Public 
con As SqlConnection
    Sub abrir
()
        If 
IsNothing(conThen
            con 
= New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
            
con.Open()
        
End If
    
End Sub
    
Public Function ejecutar(ByVal orden As String) As Integer
        abrir
()
        
Dim cmd As New SqlCommand(ordencon)
        Return 
cmd.ExecuteNonQuery
    End 
Function
    Public Function 
consultar(ByVal orden As String) As SqlDataReader
        abrir
()
        
Dim cmd As New SqlCommand(ordencon)
        Return 
cmd.ExecuteReader
    End 
Function
    Public Function 
escalar(ByVal orden As String) As Object
        abrir
()
        
Dim cmd As New SqlCommand(ordencon)
        Return 
cmd.ExecuteScalar
    End 
Function
End Class