R
Ricardo Magalhaes
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)
As
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.SelectCommand.Parameters.Add(objParam1)
daCurso.Fill(dsCursos, "cursor")
ddlMiniCursoOpcao1.DataSource = dsCursos
ddlMiniCursoOpcao1.DataSource = dsCursos.Tables(0)
ddlMiniCursoOpcao1.DataTextField =
dsCursos.Tables(0).Columns("ds_curso").ColumnName.ToString()
ddlMiniCursoOpcao1.DataValueField =
dsCursos.Tables(0).Columns("cd_curso").ColumnName.ToString()
ddlMiniCursoOpcao1.DataBind()
Best Regards,
Ricardo Magalhães
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)
As
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.SelectCommand.Parameters.Add(objParam1)
daCurso.Fill(dsCursos, "cursor")
ddlMiniCursoOpcao1.DataSource = dsCursos
ddlMiniCursoOpcao1.DataSource = dsCursos.Tables(0)
ddlMiniCursoOpcao1.DataTextField =
dsCursos.Tables(0).Columns("ds_curso").ColumnName.ToString()
ddlMiniCursoOpcao1.DataValueField =
dsCursos.Tables(0).Columns("cd_curso").ColumnName.ToString()
ddlMiniCursoOpcao1.DataBind()
Best Regards,
Ricardo Magalhães