无法打开连接Crystal Reports

时间:2018-09-08 17:50:17

标签: c# sql-server crystal-reports

我正在使用Visual Studio 2017和SQL Server 2017以及Crystal Reports的最新版本。然后,使用该代码从app.config获取连接信息,然后在SQL Server中创建存储过程,并在Visual Studio(C#)中创建新报表。

当我尝试使程序在PC客户端中运行时,我遇到无法打开连接温度的问题-错误显示在下面的屏幕截图中。

这是连接信息的代码:

SaleReportCrystal aLL_PUSH_STUDENTS = new SaleReportCrystal();
System.Data.Common.DbConnectionStringBuilder builder = new System.Data.Common.DbConnectionStringBuilder();

builder.ConnectionString = ConfigurationManager.ConnectionStrings["Connection"].ConnectionString; ;

string server = builder["Data Source"] as string;
string database = builder["Initial Catalog"] as string;
string UserID = builder["User ID"] as string;
string password1 = builder["Password"] as string;

aLL_PUSH_STUDENTS.SetDatabaseLogon(UserID, password1, server, database);

ReportPrint studentInforamtionRep = new ReportPrint();
studentInforamtionRep.crystalReportViewer1.ReportSource = aLL_PUSH_STUDENTS;
studentInforamtionRep.ShowDialog();

错误:

image

1 个答案:

答案 0 :(得分:0)

该错误代码(17)表示:“服务器不存在或访问被拒绝。”

希望这能为您指明正确的方向。

相关问题