There is at least one other thread with this title or one very close to it but it was not quite like my specific implementation and I couldn't find my answer in it. I have this code
<code>
List<string> lsRes = new List<string>();
OracleConnection conn = getOracleConnection();
try
{
string sqlQuery = "select CTS.SEQ_BATCH_ID.nextval from dual connect by
level <= " + seqCnt;
conn.Open();
OracleCommand cmd = new OracleCommand(sqlQuery, conn);
cmd.CommandType = CommandType.Text;
OracleDataReader dr;
dr = cmd.ExecuteReader();
while (dr.Read())
lsRes.Add(dr.GetValue(0).ToString());
}
catch(exception e)
{
</code>
I'm getting my InvalidOperationException on dr.GetValue(0). Any idea why? Sequence should be returning a number or numbers, I'm converting it/them to a string/strings, Should I be using GetOracleValue? There are no precompiler or compilation errors just in runtime.