Exemple #1
0
        /// <summary>
        /// The get dataset.
        /// </summary>
        /// <param name="dbAccess">
        /// The db access.
        /// </param>
        /// <param name="cmd">
        /// The cmd.
        /// </param>
        /// <returns>
        /// </returns>
        public static DataSet GetDataset([NotNull] this IDbAccess dbAccess, [NotNull] IDbCommand cmd)
        {
            CodeContracts.ArgumentNotNull(dbAccess, "dbAccess");
            CodeContracts.ArgumentNotNull(cmd, "cmd");

            return(dbAccess.GetDataset(cmd, false));
        }
Exemple #2
0
        /// <summary>
        /// Gets the data.
        /// </summary>
        /// <param name="dbAccess">The DB access.</param>
        /// <param name="cmd">The command.</param>
        /// <param name="dbTransaction">The database transaction.</param>
        /// <returns>
        /// The <see cref="DataTable" /> .
        /// </returns>
        public static DataTable GetData(
            [NotNull] this IDbAccess dbAccess, [NotNull] IDbCommand cmd, [CanBeNull] IDbTransaction dbTransaction = null)
        {
            CodeContracts.VerifyNotNull(dbAccess, "dbAccess");
            CodeContracts.VerifyNotNull(cmd, "cmd");

            return(dbAccess.GetDataset(cmd, dbTransaction).Tables[0]);
        }