Exemplo n.º 1
0
 internal string GetString(NativeBuffer_RowBuffer buffer)
 {
     if (this.IsLob)
     {
         System.Data.OracleClient.OracleType oracleType = this._metaType.OracleType;
         if (((System.Data.OracleClient.OracleType.Clob != oracleType) && (System.Data.OracleClient.OracleType.NClob != oracleType)) && (System.Data.OracleClient.OracleType.BFile != oracleType))
         {
             throw System.Data.Common.ADP.InvalidCast();
         }
         if (this.IsDBNull(buffer))
         {
             throw System.Data.Common.ADP.DataReaderNoData();
         }
         using (OracleLob lob = new OracleLob(this._lobLocator))
         {
             return((string)lob.Value);
         }
     }
     if (typeof(string) != this._metaType.BaseType)
     {
         throw System.Data.Common.ADP.InvalidCast();
     }
     if (this.IsDBNull(buffer))
     {
         throw System.Data.Common.ADP.DataReaderNoData();
     }
     this.FixupLongValueLength(buffer);
     return(OracleString.MarshalToString(buffer, this._valueOffset, this._lengthOffset, this._metaType, this._connection, this._bindAsUTF16, false));
 }