Why Do I get OutOfRange Exception in GetOrdinal Function of this CLOB field?

后端 未结 2 752
南方客
南方客 2020-12-21 15:39

This is the sample of my code. The field FUNCTION_SCRIPT is a CLOB field (the only CLOB field) in my table IS_FUNCTION

public void ReadFunction(string FName         


        
2条回答
  •  眼角桃花
    2020-12-21 16:26

    Thanks for all the suggestions and helps. I found that my problem was resolved by adding a

     if(odr.Read())
                {
                    int temp = odr.GetOrdinal("FUNCTION_SCRIPT");
                    OracleLob myLob = odr.GetOracleLob(temp);
                    fContent = (String)myLob.Value;
                }
    

    In other words, I was missing the statement odr.Read after the ExecuteReader() statement.

提交回复
热议问题