예제 #1
0
        /// <summary>
        /// Execute Non-Query
        /// </summary>
        /// <param name="proc">Procedure To Execute</param>
        /// <returns>rows affected</returns>
        public static int ExecuteNonQuery(this IStoredProc proc)
        {
            var rowsAffected = 0;
            var database     = DatabaseFactory.CreateDatabase();

            using (var command = proc.BuildCommand(database))
            {
                rowsAffected = database.ExecuteNonQuery(command);
            }

            return(rowsAffected);
        }
예제 #2
0
        /// <summary>
        /// Execute IStored Proc
        /// </summary>
        /// <param name="proc">Procedure</param>
        /// <returns>Data Set</returns>
        public static DataSet Execute(this IStoredProc proc)
        {
            DataSet dataSet  = null;
            var     database = DatabaseFactory.CreateDatabase();

            using (var command = proc.BuildCommand(database))
            {
                dataSet = database.ExecuteDataSet(command);
            }

            return(dataSet);
        }