Lesson 2: Specify connection information (Reporting Services)
In lesson 1, you added a Reporting Services paginated report to your Tutorial project.
In this lesson, you're going to define a data source, connection information the report uses to access data from a relational database or other sources.
For this report, you're going to add the AdventureWorks2022
sample database as your data source. This tutorial assumes that the database is located in the default instance of SQL Server Database Engine and installed on your local computer.
Set up a connection
In the Report Data pane, select New > Data Source. If the Report Data pane isn't visible, then select View menu > Report Data.
The Data Source Properties dialog box opens with the General section displayed.
In the Name text box, enter "AdventureWorks2022".
Select the Embedded connection radio button.
In the Type dropdown selection box, select "Microsoft SQL Server".
In the Connection string text box, type the following string:
Data source=localhost; initial catalog=AdventureWorks2022
Note
This connection string assumes that SQL Server Data Tools (SSDT), the report server, and the
AdventureWorks2022
database are all installed on the local computer.Change the connection string and replace "localhost" with the name of your database server/instance if the assumption isn't true. If you're using SQL Server Express or a SQL Server named instance, you need to modify your connection string to include instance information. For example:
Data source=localhost\SQLEXPRESS; initial catalog=AdventureWorks2022
For more information about connection strings, see the
Related content
section.Select the Credentials tab, and under the section Change the credentials used to connect to the data source, select the Use Windows Authentication (integrated security) radio button.
Select OK to complete the process.
Report Designer adds the data source AdventureWorks2022 to the Report Data pane.
Next step
In this lesson, you successfully defined a connection to the AdventureWorks2022
sample database. Continue with Lesson 3: Define a dataset for the table report (Reporting Services) to define a dataset for the report.
Related content
คำติชม
https://aka.ms/ContentUserFeedback
เร็วๆ นี้: ตลอดปี 2024 เราจะขจัดปัญหา GitHub เพื่อเป็นกลไกคำติชมสำหรับเนื้อหา และแทนที่ด้วยระบบคำติชมใหม่ สำหรับข้อมูลเพิ่มเติม ให้ดู:ส่งและดูข้อคิดเห็นสำหรับ