Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OleDbSqlServerSqlCall" /> class.
 /// </summary>
 /// <param name="dataSource">The data source.</param>
 /// <param name="sqlStatement">The SQL statement.</param>
 /// <param name="argumentValue">The argument value.</param>
 /// <exception cref="ArgumentException">sqlStatement is null or empty.;sqlStatement</exception>
 public OleDbSqlServerSqlCall(OleDbSqlServerDataSourceBase dataSource, string sqlStatement, object?argumentValue) : base(dataSource, sqlStatement, argumentValue)
 {
     if (string.IsNullOrEmpty(sqlStatement))
     {
         throw new ArgumentException($"{nameof(sqlStatement)} is null or empty.", nameof(sqlStatement));
     }
 }
Exemplo n.º 2
0
    /// <summary>
    /// Initializes a new instance of the <see cref="OleDbSqlServerDeleteSet" /> 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 OleDbSqlServerDeleteSet(OleDbSqlServerDataSourceBase dataSource, SqlServerObjectName 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);
    }
Exemplo n.º 3
0
    /// <summary>
    /// Initializes a new instance of the <see cref="OleDbSqlServerProcedureCall"/> class.
    /// </summary>
    /// <param name="dataSource">The data source.</param>
    /// <param name="procedureName">Name of the procedure.</param>
    /// <param name="argumentValue">The argument value.</param>
    internal OleDbSqlServerProcedureCall(OleDbSqlServerDataSourceBase dataSource, SqlServerObjectName procedureName, object?argumentValue) : base(dataSource, argumentValue)
    {
        if (procedureName == SqlServerObjectName.Empty)
        {
            throw new ArgumentException($"{nameof(procedureName)} is empty", nameof(procedureName));
        }

        m_Procedure = DataSource.DatabaseMetadata.GetStoredProcedure(procedureName);
    }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlServerSqlCall" /> class.
        /// </summary>
        /// <param name="dataSource">The data source.</param>
        /// <param name="sqlStatement">The SQL statement.</param>
        /// <param name="argumentValue">The argument value.</param>
        /// <exception cref="ArgumentException">sqlStatement is null or empty.;sqlStatement</exception>
        public OleDbSqlServerSqlCall(OleDbSqlServerDataSourceBase dataSource, string sqlStatement, object argumentValue) : base(dataSource)
        {
            if (string.IsNullOrEmpty(sqlStatement))
            {
                throw new ArgumentException("sqlStatement is null or empty.", "sqlStatement");
            }

            m_SqlStatement  = sqlStatement;
            m_ArgumentValue = argumentValue;
        }
Exemplo n.º 5
0
    /// <summary>
    /// Initializes a new instance of the <see cref="OleDbSqlServerTableOrView{TObject}" /> 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>
    /// <exception cref="System.ArgumentException"></exception>
    public OleDbSqlServerTableOrView(OleDbSqlServerDataSourceBase dataSource, SqlServerObjectName tableOrViewName, object filterValue, FilterOptions filterOptions = FilterOptions.None) : base(dataSource)
    {
        if (tableOrViewName == SqlServerObjectName.Empty)
        {
            throw new ArgumentException($"{nameof(tableOrViewName)} is empty", nameof(tableOrViewName));
        }

        m_FilterValue   = filterValue;
        m_FilterOptions = filterOptions;
        m_Table         = DataSource.DatabaseMetadata.GetTableOrView(tableOrViewName);
    }
Exemplo n.º 6
0
    /// <summary>
    /// Initializes a new instance of the <see cref="OleDbSqlServerTableOrView{TObject}"/> class.
    /// </summary>
    /// <param name="dataSource">The data source.</param>
    /// <param name="tableOrViewName">Name of the table or view.</param>
    /// <param name="whereClause">The where clause.</param>
    /// <param name="argumentValue">The argument value.</param>
    public OleDbSqlServerTableOrView(OleDbSqlServerDataSourceBase dataSource, SqlServerObjectName tableOrViewName, string?whereClause, object?argumentValue) : base(dataSource)
    {
        if (tableOrViewName == SqlServerObjectName.Empty)
        {
            throw new ArgumentException($"{nameof(tableOrViewName)} is empty", nameof(tableOrViewName));
        }

        m_ArgumentValue = argumentValue;
        m_WhereClause   = whereClause;
        m_Table         = DataSource.DatabaseMetadata.GetTableOrView(tableOrViewName);
    }
Exemplo n.º 7
0
    /// <summary>
    /// Initializes a new instance of the <see cref="OleDbSqlServerUpdateSet" /> 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 OleDbSqlServerUpdateSet(OleDbSqlServerDataSourceBase dataSource, SqlServerObjectName 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;
    }
Exemplo n.º 8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlServerDeleteMany" /> 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 OleDbSqlServerDeleteMany(OleDbSqlServerDataSourceBase dataSource, SqlServerObjectName 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;
        }
Exemplo n.º 9
0
    /// <summary>
    /// Initializes a new instance of the <see cref="OleDbSqlServerUpdateSet" /> 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 OleDbSqlServerUpdateSet(OleDbSqlServerDataSourceBase dataSource, SqlServerObjectName 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;
    }
Exemplo n.º 10
0
    /// <summary>
    /// Initializes a new instance of the <see cref="OleDbSqlServerUpdateSet" /> 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 OleDbSqlServerUpdateSet(OleDbSqlServerDataSourceBase dataSource, SqlServerObjectName 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;
    }
Exemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OleDbSqlServerDeleteMany"/> 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 OleDbSqlServerDeleteMany(OleDbSqlServerDataSourceBase dataSource, SqlServerObjectName tableName, object filterValue, FilterOptions filterOptions) : base(dataSource)
 {
     m_Table         = dataSource.DatabaseMetadata.GetTableOrView(tableName);
     m_FilterValue   = filterValue;
     m_FilterOptions = filterOptions;
 }
Exemplo n.º 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OleDbSqlServerDeleteSet"/> 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 OleDbSqlServerDeleteSet(OleDbSqlServerDataSourceBase dataSource, SqlServerObjectName tableName, string whereClause, object?argumentValue) : base(dataSource, whereClause, argumentValue)
 {
     m_Table = dataSource.DatabaseMetadata.GetTableOrView(tableName);
 }
Exemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SqlServerTableFunction" /> class.
 /// </summary>
 /// <param name="dataSource">The data source.</param>
 /// <param name="scalarFunctionName">Name of the scalar function.</param>
 /// <param name="functionArgumentValue">The function argument.</param>
 public OleDbSqlServerScalarFunction(OleDbSqlServerDataSourceBase dataSource, SqlServerObjectName scalarFunctionName, object functionArgumentValue) : base(dataSource)
 {
     m_Function = dataSource.DatabaseMetadata.GetScalarFunction(scalarFunctionName);
     m_FunctionArgumentValue = functionArgumentValue;
 }
Exemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OleDbSqlServerDeleteMany" /> 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>
 public OleDbSqlServerDeleteMany(OleDbSqlServerDataSourceBase dataSource, SqlServerObjectName tableName, string whereClause, IEnumerable <OleDbParameter> parameters) : base(dataSource)
 {
     m_Table       = dataSource.DatabaseMetadata.GetTableOrView(tableName);
     m_WhereClause = whereClause;
     m_Parameters  = parameters;
 }
Exemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OleDbSqlServerUpdateObject{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>
 /// <param name="options">The options.</param>
 public OleDbSqlServerUpdateObject(OleDbSqlServerDataSourceBase dataSource, SqlServerObjectName tableName, TArgument argumentValue, UpdateOptions options) : base(dataSource, tableName, argumentValue)
 {
     m_Options = options;
 }
Exemplo n.º 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OleDbSqlServerTableFunction" /> class.
 /// </summary>
 /// <param name="dataSource">The data source.</param>
 /// <param name="tableFunctionName">Name of the table function.</param>
 /// <param name="functionArgumentValue">The function argument.</param>
 public OleDbSqlServerTableFunction(OleDbSqlServerDataSourceBase dataSource, SqlServerObjectName tableFunctionName, object functionArgumentValue) : base(dataSource)
 {
     m_Table = dataSource.DatabaseMetadata.GetTableFunction(tableFunctionName);
     m_FunctionArgumentValue = functionArgumentValue;
 }
Exemplo n.º 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OleDbSqlServerObjectCommand{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 OleDbSqlServerObjectCommand(OleDbSqlServerDataSourceBase dataSource, SqlServerObjectName tableName, TArgument argumentValue)
     : base(dataSource, argumentValue)
 {
     Table = DataSource.DatabaseMetadata.GetTableOrView(tableName);
 }
Exemplo n.º 18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OleDbSqlServerDeleteMany"/> 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 OleDbSqlServerDeleteMany(OleDbSqlServerDataSourceBase dataSource, SqlServerObjectName tableName, string whereClause, object argumentValue) : base(dataSource)
 {
     m_Table         = dataSource.DatabaseMetadata.GetTableOrView(tableName);
     m_WhereClause   = whereClause;
     m_ArgumentValue = argumentValue;
 }