internal byte[] getBytes(int columnIndex)
        {
            string     val        = getObjectInternal(columnIndex);
            SFDataType sfDataType = sfResultSetMetaData.getColumnTypeByIndex(columnIndex);

            return((byte[])SFDataConverter.convertToCSharpVal(val, sfDataType, typeof(byte[])));
        }
Esempio n. 2
0
        internal object GetValue(int columnIndex)
        {
            UTF8Buffer val   = getObjectInternal(columnIndex);
            var        types = sfResultSetMetaData.GetTypesByIndex(columnIndex);

            return(SFDataConverter.ConvertToCSharpVal(val, types.Item1, types.Item2));
        }
        internal int getInt32(int columnIndex)
        {
            string     val        = getObjectInternal(columnIndex);
            SFDataType sfDataType = sfResultSetMetaData.getColumnTypeByIndex(columnIndex);

            return((Int32)SFDataConverter.convertToCSharpVal(val, sfDataType, typeof(Int32)));
        }
        internal bool getBoolean(int columnIndex)
        {
            string     val        = getObjectInternal(columnIndex);
            SFDataType sfDataType = sfResultSetMetaData.getColumnTypeByIndex(columnIndex);

            return((bool)SFDataConverter.convertToCSharpVal(val, sfDataType, typeof(Boolean)));
        }
Esempio n. 5
0
        internal T GetValue <T>(int columnIndex)
        {
            string val   = getObjectInternal(columnIndex);
            var    types = sfResultSetMetaData.GetTypesByIndex(columnIndex);

            return((T)SFDataConverter.ConvertToCSharpVal(val, types.Item1, typeof(T)));
        }
        internal DateTimeOffset getDateTimeOffset(int columnIndex)
        {
            string     val        = getObjectInternal(columnIndex);
            SFDataType sfDataType = sfResultSetMetaData.getColumnTypeByIndex(columnIndex);

            return((DateTimeOffset)SFDataConverter.convertToCSharpVal(
                       val, sfDataType, typeof(DateTimeOffset)));
        }
        internal string getString(int columnIndex)
        {
            SFDataType sfDataType = sfResultSetMetaData.getColumnTypeByIndex(columnIndex);

            switch (sfDataType)
            {
            case SFDataType.DATE:
                return(SFDataConverter.toDateString(getDateTime(columnIndex),
                                                    sfResultSetMetaData.dateOutputFormat));

            default:
                return(getObjectInternal(columnIndex));
            }
        }
Esempio n. 8
0
        internal string GetString(int columnIndex)
        {
            var type = sfResultSetMetaData.getColumnTypeByIndex(columnIndex);

            switch (type)
            {
            case SFDataType.DATE:
                var val = GetValue(columnIndex);
                if (val == DBNull.Value)
                {
                    return(null);
                }
                return(SFDataConverter.toDateString((DateTime)val,
                                                    sfResultSetMetaData.dateOutputFormat));

            //TODO: Implement SqlFormat for timestamp type, aka parsing format specified by user and format the value
            default:
                return(getObjectInternal(columnIndex).SafeToString());
            }
        }
 protected SFBaseResultSet()
 {
     dataConverter = new SFDataConverter();
 }