コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DataTableCommandBuilder"/> class.
        /// </summary>
        /// <param name="dt">The <see cref="System.Data.DataTable"/>.</param>
        /// <param name="connection">The database connection.</param>
        /// <param name="dialect">The type of SQL dialect.</param>
        public DataTableCommandBuilder(DataTable dt, DbConnection connection, SqlDialect dialect)
        {
            if (dt == null)
            {
                throw new ArgumentNullException("dt");
            }
            if (connection == null)
            {
                throw new ArgumentNullException("connection");
            }

            dataTable   = dt;
            _connection = connection;
            SqlDialect  = dialect ?? SqlDialect.Create(connection);
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DataTableCommandBuilder"/> class.
        /// </summary>
        /// <param name="ds">The <see cref="System.Data.DataSet"/> containing the specified <see cref="System.Data.DataTable"/>.</param>
        /// <param name="tableName">Name of the DataTable.</param>
        /// <param name="connection">The database connection.</param>
        /// <param name="dialect">The type of SQL dialect.</param>
        public DataTableCommandBuilder(DataSet ds, string tableName, DbConnection connection, SqlDialect dialect)
        {
            if (ds == null)
            {
                throw new ArgumentNullException("ds");
            }
            if (String.IsNullOrEmpty(tableName))
            {
                throw new ArgumentNullException("tableName");
            }
            if (connection == null)
            {
                throw new ArgumentNullException("connection");
            }

            _connection = connection;
            SqlDialect  = dialect ?? SqlDialect.Create(connection);
            dataTable   = ds.Tables[tableName];
        }