OracleParameter[] para = new OracleParameter[] {
new OracleParameter("startMonth",OracleDbType.Varchar2,"2019-01-01", ParameterDirection.Input),
new OracleParameter( "ENDMONTH",OracleDbType.Varchar2,"2019-04-01",ParameterDirection.Input ),
new OracleParameter( "P_CUR",OracleDbType.RefCursor ,ParameterDirection.Output)
};
public static DataTable GetDataByProcedure(string proName, OracleParameter[] paras)
{
using (OracleConnection conn = new OracleConnection(strConn))
{
OracleCommand cmd = new OracleCommand(proName, conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddRange(paras);
OracleDataAdapter oda = new OracleDataAdapter(cmd);
conn.Open();
DataSet ds = new DataSet();
oda.Fill(ds);
conn.Close();
return ds.Tables[0];
}
}