Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/01/2008, 01:36
Avatar de hector2c
hector2c
 
Fecha de Ingreso: noviembre-2007
Ubicación: Perú - Tacna
Mensajes: 979
Antigüedad: 17 años, 3 meses
Puntos: 25
Pregunta Re: funciones y procedure !!!

hola, discupen acabo de resolver mi problema:

Código:
    Public Function consultar() As DataSet

        Dim obj_conexion As New cls_conexion
        Dim obj_command As New SqlCommand

        obj_command.Connection = obj_conexion.obj_SqlConnection
        obj_command.CommandType = CommandType.StoredProcedure
        obj_command.CommandText = "usp_categoria_consultar"

        Dim obj_data_set As New DataSet
        Dim obj_data_adapter As New SqlDataAdapter(obj_command)

        obj_conexion.conexion()
        obj_data_adapter.Fill(obj_data_set, "categoria")
        obj_conexion.desconexion()
        consultar = obj_data_set

    End Function
y obtengo el valor en la grilla con

Código:
    Private Sub grilla_mostrar_datos()
        Me.dg_cat.DataSource = obj_cat.consultar
        Me.dg_cat.DataMember = "categoria"
    End Sub
si alguien cree que hay mejores maneras de resolver este tipo de problemas, por favor responda, gracias