Hello,
I am querying an oracle database to get the min and max of a field, and I'm trying to do it as efficiently as possible for my C# app. The code I have is as such:
command.Command Text="SELECT MIN(row_id), MAX(row_id) from my_table t where row_id is not null";
OracleDataReade r reader=command. ExecuteReader() ;
int min=reader.GetO rdinal("min(row _id)");
int max=reader.GetO rdinal("min(row _id)");
reader.Read();
callnumber=read er.GetInt32(min );
maxnumber=reade r.GetInt32(max) ;
However, I keep getting the following error when trying to set callnumber.
System.InvalidC astException: Specified cast is not valid..
callnumber and maxnumber are just standard C# ints, declared as class variables. Any help is appreciated.
I am querying an oracle database to get the min and max of a field, and I'm trying to do it as efficiently as possible for my C# app. The code I have is as such:
command.Command Text="SELECT MIN(row_id), MAX(row_id) from my_table t where row_id is not null";
OracleDataReade r reader=command. ExecuteReader() ;
int min=reader.GetO rdinal("min(row _id)");
int max=reader.GetO rdinal("min(row _id)");
reader.Read();
callnumber=read er.GetInt32(min );
maxnumber=reade r.GetInt32(max) ;
However, I keep getting the following error when trying to set callnumber.
System.InvalidC astException: Specified cast is not valid..
callnumber and maxnumber are just standard C# ints, declared as class variables. Any help is appreciated.
Comment