Unable to cast object of type 'CoreLab.Oracle.OracleNumber' to type 'System.IConvertible'.
at System.Convert.ToInt32(Object value)
at CoreLab.Oracle.OracleLoader.a(Int32 A_0, OracleNumber A_1, OracleLoaderColumnCollection A_2)
at CoreLab.Oracle.OracleLoader.SetNumber(Int32 i, OracleNumber value)
at CoreLab.Oracle.OracleLoader.SetNumber(String name, OracleNumber value)
at MDInterfaces.Interfaces.DTNInterface.GetAllTicks() in C:\Documents and Settings\pheemj\My Documents\Visual Studio 2008\Projects\MarketData\MDInterfaces\Interfaces\DTNInterface.cs:line 131
at Program.GetAllTicks() in C:\Documents and Settings\pheemj\My Documents\Visual Studio 2008\Projects\MarketData\GetMarketData\Program.cs:line 54
at Program.Main(String[] args) in C:\Documents and Settings\pheemj\My Documents\Visual Studio 2008\Projects\MarketData\GetMarketData\Program.cs:line 20
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Table Layout
create table TICK_DATA_HEADER_NEW
(
TH_ID NUMBER not null,
TH_SESSION DATE not null,
TH_TICKERSYMBOL VARCHAR2(15) not null,
TH_TIMEZONE NUMBER(4) not null,
TH_TICK_CNT NUMBER(7) not null,
TH_FRACTION NUMBER(1) not null
)
Code:
header = new OracleLoader();
header.Connection = conn;
header.TableName = "tick_data_header_new";
header.CreateColumns();
header.Open();
.
.
.
header.SetNumber("TH_TIMEZONE", h.TimeZone);
header.SetNumber("TH_FRACTION", h.Fraction);
I've tried different variations of calling SetNumber without success. If I change the precision of the columns to say number(5,1) then it works.
OracleDirect 4.75.42.0
Oracle 9i