Oracle and .NET stored procedures returning dataset...

Discussion in 'ASP .Net' started by Ricardo Magalhaes, Jun 21, 2005.

  1. Hi,

    How can I return a DataSet from oracle stored procedure(that returns for
    example, the customers from Brasil) to my ASP.NET application

    In Sql server is easy.. and seens like this:

    ------------ into sql

    Procedure SP_cursos (@categoriaID Int)


    Select ds_curso from curso where ID_Categoria = @categoriaID

    ------------------------ into my .net class

    Dim dsCursos As New DataSet
    Dim daCurso As New OleDbDataAdapter
    daCurso.SelectCommand = New OleDbCommand
    daCurso.SelectCommand.Connection = objConn
    daCurso.SelectCommand.CommandText = "SP_Cursos"
    daCurso.SelectCommand.CommandType = CommandType.StoredProcedure

    Dim objParam1 As New OleDbParameter("@categoriaID", SQLDBType.Int )
    objParam1.Direction = ParameterDirection.Input

    daCurso.Fill(dsCursos, "cursor")

    ddlMiniCursoOpcao1.DataSource = dsCursos
    ddlMiniCursoOpcao1.DataSource = dsCursos.Tables(0)
    ddlMiniCursoOpcao1.DataTextField =
    ddlMiniCursoOpcao1.DataValueField =

    Best Regards,

    Ricardo Magalhães
    Ricardo Magalhaes, Jun 21, 2005
    1. Advertisements

  2. For Oracle, you need to return a REF CURSOR. Rest of the usage remains the
    Sahil Malik [MVP], Jun 21, 2005
    1. Advertisements

  3. Thanks Sahil,

    Could you give me some example ?

    Ricardo Magalhaes, Jun 21, 2005
  4. Ricardo Magalhaes

    Paul Clement Guest

    Paul Clement, Jun 21, 2005
  5. Paul,

    Tanks a lot. It works nice...


    Ricardo Magalhães
    Ricardo Magalhaes, Jun 21, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.