繁体   English   中英

无法打开连接Crystal Reports

[英]Failed to open the connection 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();

错误:

图片

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM