After the EntityDataSource wizard appears you have to perform the following steps:
-
Choose your data connection
In this step you have to specify a data connection for the EntityDataSource component.
There are two possible options for specifying the data connection:
-
Save the connection string
This step appears only if you have specified a new connection string in the previous one. Choose "Yes, save the connection
with the following name" to store the connection string in the application configuration file under a specific name. Type
a name for the connection or use the provided default name if applicable.
Note | |
Saving the connection string in the application configuration file simplifies the process of maintaining your application
if the database connection changes. In the event of a change in the database connection you can edit the connection string
in the application configuration file as opposed to editing the source code and having to recompile your application.
|
Choose an object context
In this step you have to specify an existing ObjectContext that is responsible for accessing your entity
data model. The available ObjectContext types are organized in a hierarchical manner grouped by namespace,
as shown in the following screenshot:
Note | |
If the desired ObjectContext type does not appear in the list make sure the current project is built and
all necessary project references are added.
|
Choose an object context member
In this step you have to specify a member of the chosen ObjectContext that is responsible for data
retrieval. You can choose either a property that returns the desired entities directly or a method that
executes some business logic against the entity data model to obtain the required data for the report.
Note | |
If the chosen member does not have any parameters, this is the last step of the wizard. However, if
the specified member is a method with parameters, the next step allows you to configure those parameters.
|
Configure data source parameters
Each argument of the selected method corresponds to a data source parameter. This step allows you to
specify for each parameter a constant value, an expression, or create a new ReportParameter and the expression
will be set automatically to it.
Note | |
The names and types of the defined parameters should match exactly the arguments of the selected method.
In case this requirement is not fulfilled the EntityDataSource component will not be able to resolve or call
correctly the method and will raise an exception at runtime.
|
-
Configure Design Time Parameters
This step allows you to specify a value for each data source parameter that can be used at design time to
retrieve the schema of the EntityDataSource component.
Note | |
Specifying design time values for the parameters is necessary because the designer might need to execute the
methods in order to populate the schema displayed in the Data Explorer tool window and the Edit Expression
dialog. These values do not affect the execution of the methods at runtime however.
|
This is the last step of the wizard. After pressing the Finish button the wizard will configure the
EntityDataSource component with the specified settings and close.