简体   繁体   English

无法打开连接。CrystalReports中的详细信息[数据库供应商代码-17]

[英]Failed to open connection.Details[database vendor code-17] in Crystal Reports

Crystal Reports is working fine locally, but when it is installed on the client's PC it shows a failed to open connection error. Crystal Reports在本地运行良好,但是在客户端PC上安装Crystal Reports时,显示failed to open connection错误。

It's a Windows application in ASP.NET C# and I want it installed on Windows 10. 这是ASP.NET C#中的Windows应用程序,我希望将其安装在Windows 10上。

private void getinvoice_Click(object sender, EventArgs e) 
{
    string connStr = ConfigurationManager.ConnectionStrings["ConnString"].ConnectionString;

    SqlConnection con = new SqlConnection(connStr);
    con.Open();

    SalesReportview f2 = new SalesReportview();
    demo r1 = new demo();

    string s = "select T1.prodnm, T1.mrp, T1.prodquntity, T1.amount, T1.tax, T1.Tax_rt, T2.tottaxamt, T2.SI_Date from GST_SalesInvoice T1 inner join GST_SalesInvoice_Head T2 on T1.invoice_no = T2.Invoice_No where T1.invoice_no = '" + ino.Text + "'";

    SqlCommand cmd = new SqlCommand(s, con);
    SqlDataAdapter da = new SqlDataAdapter(cmd);

    DataSet ds = new DataSet();
    da.Fill(ds);

    r1.Load(Application.StartupPath + "~\\demo.rpt");
    r1.SetDatabaseLogon("sa", "sa", "DESKTOP-PPIVSIR", "GSTApplication");
    r1.SetDataSource(ds);
    r1.SetParameterValue("Invnum", ino.Text);

    f2.salescryrep.Refresh();
    f2.salescryrep.ReportSource = r1;
    f2.Show();

    con.Close();
}

Make sure the data source (eg ODBC DSN) is set up correctly and matches the "bitness" (x86 or x64) of the Crystal runtime used by the app. 确保数据源(例如ODBC DSN)设置正确,并且与应用程序使用的Crystal运行时的“位”(x86或x64)匹配。 For example, a 32-bit DSN can't be used for a 64-bit app. 例如,32位DSN不能用于64位应用程序。

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

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