xtrareports-1181-feature-guide-to-devexpress-reports-bind-reports-to-data-standard-net-data-providers.md
This topic explains how to bind reports to data using standard .NET data providers at design time and runtime.
Tip
You can use this approach when the SqlDataSource does not meet your requirements (for example, when you need to bind your report to an OLE DB provider or an existing DataSet object).
Create the following objects to connect a report to a .NET data provider:
The following image illustrates the data binding mechanism described above:
.NET data providers allow you to access standard data types which use different connections and data adapters:
SqlConnection and SqlDataAdapter objects work with data sources provided by Microsoft SQL Server version 7.0 or later.Tip
You can also use different third-party data adapters if they can generate and populate a report’s dataset.
You can bind a report to a DataSet in the following ways:
You need to fill the dataset with data manually by calling the data adapter’s Fill method. For instance, you could do this before previewing or printing the report. However, you can avoid manually filling the dataset by setting the XtraReportBase.DataAdapter property to the data adapter that was used to create the dataset. In this case, the report automatically populates the dataset with data.
Tip
It is possible to load only a predefined number of records from a dataset, which can reduce the load on your database server and the time it takes to generate a report when working with large datasets.
Use the XtraReport.ReportPrintOptions.DetailCount property to limit the number of data records displayed in a report. It is set to zero value by default, meaning that this property is ignored.
When a bound data source contains more than one data table, you can use the XtraReportBase.DataMember property to specify the list in the data source (normally, this is a table) whose data is used by a report control. This property is set automatically in most cases, but you can change its value if required.
See Also