Skip to main content

SqlDataSource.RebuildResultSchema(Predicate<IEnumerable<SqlQuery>>, IEnumerable<IParameter>, IEnumerable<SqlQuery>) Method

Validates and updates the result schema available on the client with the specified queries and parameters after confirming the execution of associated queries (the result schema can be accessed using the SqlDataSource.Result property). This command does not affect the actual database schema on the server.

Namespace: DevExpress.DataAccess.Sql

Assembly: DevExpress.DataAccess.v23.2.dll

NuGet Packages: DevExpress.DataAccess, DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap

Declaration

public void RebuildResultSchema(
    Predicate<IEnumerable<SqlQuery>> confirmExecution,
    IEnumerable<IParameter> parameters,
    IEnumerable<SqlQuery> queries
)

Parameters

Name Type Description
confirmExecution Predicate<IEnumerable<SqlQuery>>

A method that defines a set of criteria to determine whether or not the specified SqlQuery strings have been executed.

parameters IEnumerable<IParameter>

A collection of objects implementing the IParameter interface.

queries IEnumerable<SqlQuery>

A collection of SqlQuery objects.

Remarks

If errors occur during data connection, a DatabaseConnectionException is thrown.

All queries are validated one by one. When validation errors occur, they are collected and returned by throwing a AggregateException. Use its InnerExceptions property to access a collection of QueryExecutionException objects (use their InnerException property to access an actual ValidationException).

If the validation succeeds, all queries are executed one by one. If any errors occur during the execution of each query, these errors are collected and returned by throwing a AggregateException. Use its InnerExceptions property to access a collection of QueryExecutionException objects (use their InnerException property to access an actual DevExpress.DataAccess.Native.Sql.SqlExecutionException).

Note

When using a SqlDataSource to bind an XtraReport to data, call the RebuildResultSchema method to make the data source structure displayed in the Field List of an End-User Report Designer. For a code sample, see Bind a Report to a Microsoft SQL Server Database (Runtime Sample).

See Also