/// <summary> /// Initializes a new instance of the <see cref="AccessTableOrView" /> class. /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="tableOrViewName">Name of the table or view.</param> /// <param name="filterValue">The filter value.</param> /// <param name="filterOptions">The filter options.</param> public AccessTableOrView(AccessDataSourceBase dataSource, AccessObjectName tableOrViewName, object filterValue, FilterOptions filterOptions) : base(dataSource) { m_FilterValue = filterValue; m_Table = ((AccessDataSourceBase)DataSource).DatabaseMetadata.GetTableOrView(tableOrViewName); m_FilterOptions = filterOptions; }
/// <summary> /// Initializes a new instance of the <see cref="AccessTableOrView" /> class. /// </summary> /// <param name="dataSource"></param> /// <param name="tableOrViewName"></param> /// <param name="whereClause"></param> /// <param name="argumentValue"></param> public AccessTableOrView(AccessDataSourceBase dataSource, AccessObjectName tableOrViewName, string whereClause, object argumentValue) : base(dataSource) { m_ArgumentValue = argumentValue; m_WhereClause = whereClause; m_Table = ((AccessDataSourceBase)DataSource).DatabaseMetadata.GetTableOrView(tableOrViewName); }
/// <summary> /// Creates a new instance of <see cref="AccessSqlCall" /> /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="sqlStatement">The SQL statement.</param> /// <param name="argumentValue">The argument value.</param> /// <exception cref="System.ArgumentException">SQL statement is null or empty.;sqlStatement</exception> public AccessSqlCall(AccessDataSourceBase dataSource, string sqlStatement, object?argumentValue) : base(dataSource, sqlStatement, argumentValue) { if (string.IsNullOrEmpty(sqlStatement)) { throw new ArgumentException($"{nameof(sqlStatement)} is null or empty.", nameof(sqlStatement)); } }
/// <summary> /// Initializes a new instance of the <see cref="AccessDeleteSet" /> class. /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="tableName">Name of the table.</param> /// <param name="whereClause">The where clause.</param> /// <param name="parameters">The parameters.</param> /// <param name="expectedRowCount">The expected row count.</param> /// <param name="options">The options.</param> public AccessDeleteSet(AccessDataSourceBase dataSource, AccessObjectName tableName, string whereClause, IEnumerable <OleDbParameter> parameters, int?expectedRowCount, DeleteOptions options) : base(dataSource, whereClause, parameters, expectedRowCount, options) { if (options.HasFlag(DeleteOptions.UseKeyAttribute)) { throw new NotSupportedException("Cannot use Key attributes with this operation."); } m_Table = dataSource.DatabaseMetadata.GetTableOrView(tableName); }
/// <summary> /// Creates a new instance of <see cref="AccessSqlCall" /> /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="sqlStatement">The SQL statement.</param> /// <param name="argumentValue">The argument value.</param> /// <exception cref="System.ArgumentException">SQL statement is null or empty.;sqlStatement</exception> public AccessSqlCall(AccessDataSourceBase dataSource, string sqlStatement, object argumentValue) : base(dataSource) { if (string.IsNullOrEmpty(sqlStatement)) { throw new ArgumentException("SQL statement is null or empty.", "sqlStatement"); } m_SqlStatement = sqlStatement; m_ArgumentValue = argumentValue; }
/// <summary> /// Initializes a new instance of the <see cref="AccessUpdateSet" /> class. /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="tableName">Name of the table.</param> /// <param name="newValues">The new values.</param> /// <param name="options">The options.</param> /// <exception cref="System.NotSupportedException">Cannot use Key attributes with this operation.</exception> public AccessUpdateSet(AccessDataSourceBase dataSource, AccessObjectName tableName, object?newValues, UpdateOptions options) : base(dataSource) { if (options.HasFlag(UpdateOptions.UseKeyAttribute)) { throw new NotSupportedException("Cannot use Key attributes with this operation."); } m_Table = dataSource.DatabaseMetadata.GetTableOrView(tableName); m_NewValues = newValues; m_Options = options; }
/// <summary> /// Initializes a new instance of the <see cref="AccessUpdateSet" /> class. /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="tableName">Name of the table.</param> /// <param name="updateExpression">The update expression.</param> /// <param name="updateArgumentValue">The update argument value.</param> /// <param name="options">The options.</param> /// <exception cref="System.NotSupportedException">Cannot use Key attributes with this operation.</exception> public AccessUpdateSet(AccessDataSourceBase dataSource, AccessObjectName tableName, string updateExpression, object?updateArgumentValue, UpdateOptions options) : base(dataSource) { if (options.HasFlag(UpdateOptions.UseKeyAttribute)) { throw new NotSupportedException("Cannot use Key attributes with this operation."); } m_Table = dataSource.DatabaseMetadata.GetTableOrView(tableName); m_UpdateExpression = updateExpression; m_Options = options; m_UpdateArgumentValue = updateArgumentValue; }
/// <summary> /// Initializes a new instance of the <see cref="AccessDeleteMany" /> class. /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="tableName">Name of the table.</param> /// <param name="whereClause">The where clause.</param> /// <param name="parameters">The parameters.</param> /// <param name="options">The options.</param> public AccessDeleteMany(AccessDataSourceBase dataSource, AccessObjectName tableName, string whereClause, IEnumerable <OleDbParameter> parameters, DeleteOptions options) : base(dataSource) { if (options.HasFlag(DeleteOptions.UseKeyAttribute)) { throw new NotSupportedException("Cannot use Key attributes with this operation."); } m_Table = dataSource.DatabaseMetadata.GetTableOrView(tableName); m_WhereClause = whereClause; //m_Options = options; m_Parameters = parameters; }
/// <summary> /// Initializes a new instance of the <see cref="AccessUpdateSet" /> class. /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="tableName">Name of the table.</param> /// <param name="newValues">The new values.</param> /// <param name="whereClause">The where clause.</param> /// <param name="parameters">The parameters.</param> /// <param name="expectedRowCount">The expected row count.</param> /// <param name="options">The options.</param> public AccessUpdateSet(AccessDataSourceBase dataSource, AccessObjectName tableName, object?newValues, string whereClause, IEnumerable <OleDbParameter> parameters, int?expectedRowCount, UpdateOptions options) : base(dataSource) { if (options.HasFlag(UpdateOptions.UseKeyAttribute)) { throw new NotSupportedException("Cannot use Key attributes with this operation."); } m_Table = dataSource.DatabaseMetadata.GetTableOrView(tableName); m_NewValues = newValues; m_WhereClause = whereClause; m_ExpectedRowCount = expectedRowCount; m_Options = options; m_Parameters = parameters; }
/// <summary> /// Initializes a new instance of the <see cref="AccessDeleteObject{TArgument}"/> class. /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="tableName">The table.</param> /// <param name="argumentValue">The argument value.</param> /// <param name="options">The options.</param> public AccessDeleteObject(AccessDataSourceBase dataSource, AccessObjectName tableName, TArgument argumentValue, DeleteOptions options) : base(dataSource, tableName, argumentValue) { m_Options = options; }
/// <summary> /// Initializes a new instance of the <see cref="AccessDeleteMany"/> class. /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="tableName">Name of the table.</param> /// <param name="whereClause">The where clause.</param> /// <param name="argumentValue">The argument value.</param> public AccessDeleteMany(AccessDataSourceBase dataSource, AccessObjectName tableName, string whereClause, object?argumentValue) : base(dataSource) { m_Table = dataSource.DatabaseMetadata.GetTableOrView(tableName); m_WhereClause = whereClause; m_ArgumentValue = argumentValue; }
/// <summary> /// Initializes a new instance of the <see cref="AccessObjectCommand{TArgument}" /> class /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="tableName">Name of the table.</param> /// <param name="argumentValue">The argument value.</param> protected AccessObjectCommand(AccessDataSourceBase dataSource, AccessObjectName tableName, TArgument argumentValue) : base(dataSource, argumentValue) { Table = ((AccessDataSourceBase)DataSource).DatabaseMetadata.GetTableOrView(tableName); }
/// <summary> /// Initializes a new instance of the <see cref="AccessDeleteSet"/> class. /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="tableName">Name of the table.</param> /// <param name="filterValue">The filter value.</param> /// <param name="filterOptions">The options.</param> public AccessDeleteSet(AccessDataSourceBase dataSource, AccessObjectName tableName, object filterValue, FilterOptions filterOptions) : base(dataSource, filterValue, filterOptions) { m_Table = dataSource.DatabaseMetadata.GetTableOrView(tableName); }
/// <summary> /// Initializes a new instance of the <see cref="AccessDeleteSet"/> class. /// </summary> /// <param name="dataSource">The data source.</param> /// <param name="tableName">Name of the table.</param> /// <param name="whereClause">The where clause.</param> /// <param name="argumentValue">The argument value.</param> public AccessDeleteSet(AccessDataSourceBase dataSource, AccessObjectName tableName, string whereClause, object?argumentValue) : base(dataSource, whereClause, argumentValue) { m_Table = dataSource.DatabaseMetadata.GetTableOrView(tableName); }