Argentini.Halide.H3Reader.Read C# (CSharp) Метод

Read() публичный Метод

Read the first (or next) row in the query.
public Read ( ) : bool
Результат bool
        public bool Read()
        {
            bool output = false;

            try
            {
                if (dr_Oledb != null)
                {
                    output = dr_Oledb.Read();
                }

                else
                {
                    output = dr.Read();
                }

                if (output)
                {
                    _RowsRead++;
                }
            }

            catch (Exception err)
            {
                _lastSqlError = err;
            }

            return output;
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Instantiate the class with a complete SQL statement.
        /// </summary>
        /// <example>
        /// <code>
        /// using Argentini.Halide;
        /// ...
        /// H3DataRow dataRow = new H3DataRow("SELECT TOP 1 * FROM Data WHERE ID=5;", "SqlServer01");
        /// </code>
        /// </example>
        /// <param name="sqlCommand">Complete SQL command string to use for reading the desired row.</param>
        /// <param name="UseconnectionStringName">Name of a connection string within the Web.config file.</param>
        public H3DataRow(String sqlCommand, String UseconnectionStringName)
        {
            ConnectionStringName = UseconnectionStringName;
            DataPresent = false;

            using (H3Reader reader = new H3Reader(sqlCommand, true, UseconnectionStringName))
            {
                if (reader.HasRows)
                {
                    DataPresent = true;
                    reader.Read();
                    Column = new DatabaseRow(reader);
                }

                else
                {
                    Column = new DatabaseRow();
                }
            }
        }
All Usage Examples Of Argentini.Halide.H3Reader::Read