C# Oracle.DataAccess CommandType.StoredProcedure OracleDbType.Date
I cannot seem to get my code to call an oracle procedure that has a date command.
I keep getting a System.FormatException occurred in Oracle.DataAccess.dll
I've tried assigning the param.Value = DateTime, and also tried assigning as a formatted string with no luck.
What is the magic formula I need to call this function?!?!
Here's a code snippet:
OracleCommand cmd = new OracleCommand();
cmd.Connection = appConn;
cmd.CommandText = "mypackage.myprocedure";
cmd.CommandType = CommandType.StoredProcedure;
param = new OracleParameter("iDateParamter", OracleDbType.Date, ParameterDirection.Input);
param.Value = "31-AUG-2015";
// these are other formats I'ved tried... param.Value = myDateValue.ToString("dd-MMM-yyyy").ToUpper();// "MM/dd/yyyy"); //"yyyy-MM-dd"); //"MM-dd-yyyy");
cmd.Parameters.Add(param);
cmd.BindByName = true;
cmd.ExecuteNonQuery();