I have a store procedure like this :
AS
BEGIN
OPEN
resultset_out FOR SELECT * FROM ABCD;
END PRC_ABCD_GETALL;
and this procedure is in package and the package is like this
create or replace
PACKAGE V4_EVT_PKG_ABCD_GENERAL
AS
PROCEDURE PRC_ABCD_GETALL (resultset_out OUT TYPES.cursorType);
END V4_EVT_PKG_ABCD_GENERAL;
and the oracle data provider was system.data.oracleClient and I used this code
public static IEnumerable GetAll()
{
Database db = DatabaseFactory.CreateDatabase();
DbCommand objComm = db.GetStoredProcCommand("package_name.sp", new object[1]);
var result = new List();
using (IDataReader rdr = db.ExecuteReader(objComm)){
while (rdr.Read()){
result.Add(Construct(rdr));
}
}
return result;
}
and now i found out that system.data.oracleClient is depricated and i want to use Oracle.DataAccess.Client as data provider
I wrote C# code for this but I am facing some errors like wrong number or types of arguments in call to 'PRC_ABCD_GETALL'
in this function PortalListRepository.GetAll();
private static IEnumerable GetAll(bool forceDataReload)
{
const string cacheKey = "PortalListService_GetAll";
IEnumerable result = null;
if (!forceDataReload)
result = GetFromCache(cacheKey);
if (result == null)
{
result = PortalListRepository.GetAll();
AddToCache(cacheKey, result);
}
return result;
}
that I can't solve.
C# code
public static IEnumerable GetAll()
{
string cnn = "connectionstring";
var result = new List();
using (OracleConnection conn = new OracleConnection(cnn))
{
conn.Open();
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "PRC_ABCD_GETALL";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("resultset_out", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
OracleDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
result.Add(Construct(rdr));
}
}
return result;
}
I am very much new to this I don't know how to solve it.Anybody have any idea what am i doing wrong??pls help
create or replace
PACKAGE V4_EVT_PKG_ABCD_GENERAL
AS
PROCEDURE PRC_ABCD_GETALL (resultset_out OUT TYPES.cursorType);
END V4_EVT_PKG_ABCD_GENERAL;
and the oracle data provider was system.data.oracleClient and I used this code
public static IEnumerable
{
Database db = DatabaseFactory.CreateData
DbCommand objComm = db.GetStoredProcCommand("package_name.sp", new object[1]);
var result = new List
using (IDataReader rdr = db.ExecuteReader(objComm)){
while (rdr.Read()){
result.Add(Construct(rdr));
}
}
return result;
}
and now i found out that system.data.oracleClient is depricated and i want to use Oracle.DataAccess.Client as data provider
I wrote C# code for this but I am facing some errors like wrong number or types of arguments in call to 'PRC_ABCD_GETALL'
in this function PortalListRepository.GetAll();
private static IEnumerable
{
const string cacheKey = "PortalListService_GetAll";
IEnumerable
if (!forceDataReload)
result = GetFromCache(cacheKey);
if (result == null)
{
result = PortalListRepository.GetAll();
AddToCache(cacheKey, result);
}
return result;
}
that I can't solve.
C# code
public static IEnumerable
{
string cnn = "connectionstring";
var result = new List
using (OracleConnection conn = new OracleConnection(cnn))
{
conn.Open();
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "PRC_ABCD_GETALL";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("resultset_out", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
OracleDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
result.Add(Construct(rdr));
}
}
return result;
}
I am very much new to this I don't know how to solve it.Anybody have any idea what am i doing wrong??pls help
Sudipta SahaPosted Jan 4, 2018, 8:05 AM
Rajkiran SwainPosted Jan 4, 2018, 7:52 AM