A shared data source is a set of data source connection properties that can be referenced by multiple reports, models, and data-driven subscriptions that run on a Reporting Services report server.
It is created once and used in multiple reports. It provides an easy way to manage data source properties that often change over time, we change data source at one place and it will reflect in all the supporting reports.
Lets create a new project first, after creating a blank project the solution explorer looks like below.
Now, right click on Shared Data Sources Folder in Solution Explorer under project solution.
Then click on > Add > New Item…
After clicking on New Item.. , a Add New Item window appears.
then select > Data Source > give name to Data Source , Name > then click on Add button.
Once you click on Add button, a shared Data Source window appears.
Now, In General Tab > Set Name: >Set Type: Microsoft SQL Server >Next, click on Build.. button
After clicking on Build.. button, a connection properties window appears.
By default Data Source is auto filled – Microsoft SQL Server(SqlClient), no need to modify it.
> Next, choose Server name: > then, Set Authentication: you can choose either window authentication or SQL Server Authentication(need to pass credentials).
> Next, Select Database name: > finally, click on Test connection ( to ensure connection is created successfully or not)
After clicking on Test Connection, a pop up window appears to ensure that connection is created successfully or not.
> Click on OK button to close the pop up window > Next, click on Ok button.
Once, we click on OK Button, it takes you back to shared Data Source properties window.
Here, we notice that now connection string which we have created is appears in connection string text box.
In Credentials tab, we can set the credentials properties for Reports.
- Use Windows Authentication: By default it is auto checked ,It will use the current user windows credentials to connect to the data source.
- Use this User name and Password: If we set this then the report will use username and password to connect to the data source.
- Prompt for credentials: When the report is connected to the data source, it will prompt the given text (asking for credentials).
- Do not use credentials: Report will not use any credentials to connect with the data source.
Next, click on OK Button to finish final step.
Now, we can see solution explorer, data source is created inside shared data source folder.