Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ArrayDbDataReader"/> class.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <param name="schema">The schema.</param>
        public ArrayDbDataReader(object[][] data, DataReaderField[] schema)
        {
            Debug.Assert(data != null);
            Debug.Assert(schema != null);

            _data = data;
            _schema = schema;
        }
Example #2
0
        public DataReaderResult(IDataReader reader)
        {
            try
            {
                _data = ReadAll(reader).ToArray();

                _schema = new DataReaderField[reader.FieldCount];

                for (int i = 0; i < reader.FieldCount; i++)
                {
                    _schema[i] = new DataReaderField(reader.GetName(i), reader.GetFieldType(i),
                                                     reader.GetDataTypeName(i));
                }
            }
            finally
            {
                reader.Close();
                reader.Dispose();
            }
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DataReaderResult"/> class.
        /// </summary>
        public DataReaderResult(IDataReader reader)
        {
            try
            {
                _data = ReadAll(reader).ToArray();

                _schema = new DataReaderField[reader.FieldCount];

                for (int i = 0; i < reader.FieldCount; i++)
                {
                    _schema[i] = new DataReaderField(reader.GetName(i), reader.GetFieldType(i), 
                        reader.GetDataTypeName(i));
                }
            }
            finally 
            {
                reader.Close();
                reader.Dispose();
            }
        }