Ejemplo n.º 1
0
        /// <summary>
        /// Retrieve the value as the given column index
        /// </summary>
        /// <param name="index">The column value to retrieve</param>
        /// <returns>The value as the given column</returns>
        public IMySqlValue this[int index]
        {
            get
            {
                if (rowIndex < 0)
                {
                    throw new MySqlException(Resources.AttemptToAccessBeforeRead);
                }

                // keep count of how many columns we have left to access
                uaFieldsUsed[index] = true;

                if (isSequential && index != seqIndex)
                {
                    if (index < seqIndex)
                    {
                        throw new MySqlException(Resources.ReadingPriorColumnUsingSeqAccess);
                    }
                    while (seqIndex < (index - 1))
                    {
                        driver.SkipColumnValue(values[++seqIndex]);
                    }
                    values[index] = driver.ReadColumnValue(index, fields[index], values[index]);
                    seqIndex      = index;
                }

                return(values[index]);
            }
        }