Esempio n. 1
0
        /// <summary>
        /// Executes a command and returns a records reader containing the results.
        /// </summary>
        /// <param name="commandText">The command text.</param>
        /// <param name="parameters">The parameters.</param>
        /// <returns>
        /// A data reader containing the results of the command.
        /// </returns>
        protected override IRecordsReader ExecuteReader(string commandText, SqlCeParameter[] parameters)
        {
            #if DEBUG && DebugDataLayer
            // Log Query Execution
            Trace.TraceInformation(GetType().Name + " SQL ExecuteReader: " + commandText);
            #endif

            return(new SqlCeDataReaderHelper(SqlCeApplicationBlock.ExecuteReader(ConnectionString, CommandType.Text,
                                                                                 commandText, parameters)));
        }
        /// <summary>
        /// Executes a command and returns a records reader containing the results.
        /// </summary>
        /// <param name="commandText">The command text.</param>
        /// <param name="parameters">The parameters.</param>
        /// <returns>
        /// A data reader containing the results of the command.
        /// </returns>
        protected override IRecordsReader ExecuteReader(string commandText, SqlCeParameter[] parameters)
        {
#if DEBUG && DebugDataLayer
            // Log Query Execution
            Trace.TraceInformation(GetType().Name + " SQL ExecuteReader: " + commandText);
#endif

            using (var cc = UseCurrentConnection)
            {
                return(new SqlCeDataReaderHelper(SqlCeApplicationBlock.ExecuteReader(
                                                     (SqlCeConnection)cc.Connection, (SqlCeTransaction)cc.Transaction,
                                                     CommandType.Text, commandText, parameters)));
            }
        }