Nov 27, 2014 at 10:49 AM
Edited Nov 27, 2014 at 10:51 AM
Thanks for helping!
I downloaded Enterprise Library 5.0 - Data Access Application Block, EntLibContrib 5.0 - Oracle ODP.NET Data and did settings in Web.config(after some online research). I was able to get output from the Oracle stored procedure.
I created one procedure in Oracle db 10g as :
(prd_id IN NUMBER,
prdData OUT SYS_REFCURSOR )
open prdData for
and below is the code in CS file
DatabaseProviderFactory dbFactory = new DatabaseProviderFactory();
dbcmd = db.GetStoredProcCommand("USP_GETPROPOSALDATABYPRDID");
db.AddInParameter(dbcmd, "prd_id", DbType.Int32,1);
using (var reader = db.ExecuteReader(dbcmd))
ar.Add(reader);//randomly adding 2nd col only.
gdvData.DataSource = ar;//ar is ArrayList.
lblInfo.Text = db.GetType().ToString();//To know the type of Database object created.
As you mentioned previously that parameter has to be named as "cur_OUT", however in this case parameter is named as "prdData" in stored procedure and it is still working. i did some debugging and observe that inside classs OracleDatabase.cs
a call to method QueryProcedureNeedsCursorParameter(DbCommand) is made to check if parameter is needed or not and if yes it add a oracle parameter of RefCursor type and name it cur_OUT.
So does it mean name of parameter in stored proc dosen't make any difference??
I wonder how it handle two refcursor parameter.(Currently working on same).
Just wanted your opinion on same.
Once again thank you very much!!!