El codigo quedo asi
Código C#:
Ver originalpublic List<TB_Menu> mtObtnerTB_MenuPorPerfil(Int32 cnID_UsuarioPerfil)
{
List<TB_Menu> loTB_MenuLista = new List<TB_Menu>();
try
{
using (OracleConnection loConnection = new OracleConnection(attcConnectionString))
{
using (OracleCommand loCmd = loConnection.CreateCommand())
{
//loCmd.Connection = loConnection;
loCmd.CommandType = CommandType.StoredProcedure;
loCmd.CommandText = "palTB_MenuPerfilObt";
loCmd.Parameters.Add(new OracleParameter("c1", OracleDbType.RefCursor)).Direction = ParameterDirection.Output;
loCmd.Parameters.Add(new OracleParameter("VcnID_UsuarioPerfil", OracleDbType.Int32)).Value = cnID_UsuarioPerfil;
loConnection.Open();
IDataReader loReader = loCmd.ExecuteReader();
while (loReader.Read())
{
TB_Menu loTB_Menu = new TB_Menu();
loTB_Menu.CnID_Menu = Convert.ToInt32(loReader["cnID_Menu"].ToString());
loTB_Menu.CnID_MenuPadre = Convert.ToInt32((loReader["cnID_MenuPadre"] == DBNull.Value) ? null : loReader["cnID_MenuPadre"]);
loTB_Menu.CnOrdenMenu = Convert.ToInt32(loReader["cnOrdenMenu"].ToString());
loTB_Menu.CcDescMenu = loReader["ccDescMenu"].ToString();
loTB_Menu.CcDescPrograma = loReader["ccDescPrograma"].ToString();
loTB_Menu.CdFechaCreador = (DateTime)((loReader["cdFechaCreador"] == DBNull.Value) ? DateTime.MinValue : loReader["cdFechaCreador"]);
loTB_Menu.CdFechaActualizador = (DateTime?)((loReader["cdFechaActualizador"] == DBNull.Value) ? null : loReader["cdFechaActualizador"]);
loTB_Menu.CnEstadoReg = Convert.ToInt32(loReader["cnEstadoReg"].ToString());
loTB_MenuLista.Add(loTB_Menu);
}
loReader.Close();
loReader.Dispose();
loConnection.Close();
}
}
}
catch (OracleException dbex)
{
throw new System.Exception(dbex.Message);
}
//oCn.Close();
return loTB_MenuLista;
}