Preencher um DataSet usando um ou mais REF CURSORs
Este exemplo do Visual Basic executa um procedimento armazenado PL/SQL, que retorna dois parâmetros de REF CURSOR e preenche um DataSet com as linhas retornadas.
Private Sub Button1_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim connString As New String("...")
Dim ds As New DataSet()
Using conn As New OracleConnection(connString)
Dim cmd As New OracleCommand()
cmd.Connection = conn
cmd.CommandText = "CURSPKG.OPEN_TWO_CURSORS"
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add(New OracleParameter( _
"EMPCURSOR", OracleType.Cursor)).Direction = _
ParameterDirection.Output
cmd.Parameters.Add(New OracleParameter( _
"DEPTCURSOR", OracleType.Cursor)).Direction = _
ParameterDirection.Output
Dim da As New OracleDataAdapter(cmd)
da.TableMappings.Add("Table", "Emp")
da.TableMappings.Add("Table1", "Dept")
da.Fill(ds)
ds.Relations.Add("EmpDept", ds.Tables("Dept").Columns("Deptno"), _
ds.Tables("Emp").Columns("Deptno"), False)
DataGrid1.DataSource = ds.Tables("Dept")
End Using