Ejemplo n.º 1
0
        /// <summary>
        /// Ctr.
        /// </summary>
        /// <param name="connection">Parent connection</param>
        /// <param name="inputStream">Incoming data stream from server</param>
        /// <param name="holders">Array of holder objects that must be disposed when reader is closed</param>
        public PqlDataReader(PqlDataConnection connection, BufferedReaderStream inputStream, params IDisposable[] holders)
        {
            m_protocolUtility = new PqlProtocolUtility(connection, inputStream, holders);
            try
            {
                m_reader = inputStream.MyReader;
                m_scheme = m_protocolUtility.ReadResponseHeaders(inputStream);

                if (m_scheme.Fields != null && m_scheme.Fields.Length > 0)
                {
                    m_currentRow = new RowData(m_scheme.Fields.Select(x => x.DataType).ToArray());
                    m_state      = ReaderState.New;
                }
                else
                {
                    m_state = ReaderState.Closed;
                }

                connection.SwitchToFetchingState();
            }
            catch
            {
                m_protocolUtility.Dispose();
                throw;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Ctr.
 /// </summary>
 /// <param name="pqlDataConnection">Parent connection (optional). May be set later via <see cref="DbConnection"/> property</param>
 public PqlDataCommand(PqlDataConnection pqlDataConnection) : this()
 {
     m_connection = pqlDataConnection;
 }