Click here to Skip to main content
15,884,353 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Error machine on target machine while refreshing report on target machine
CSS
Failed to open the connection.
Details: [Database Vendor Code:17]
Failed to Open Connection.
payments11 {D29B3531-EF7D-426E-B1DB-05CD2A63FA5F}.rpt
Details : [Database Vendor Code:17]


this is my coding part :

C#
private void Preview_Click(object sender, EventArgs e)
        {
            SqlConnection cnn;
            string connectionString = null;
            string sql = null;

            connectionString = @"Data Source=.\SQLEXPRESS;Initial Catalog=trydb_1;Integrated Security=True";
            cnn = new SqlConnection(connectionString);
            cnn.Open();
            sql = "SELECT ID,pay_id,date,custname,description,chqno,duedate,accname,amount FROM payments";
            SqlDataAdapter dscmd = new SqlDataAdapter(sql, cnn);
 ReportDocument cryRpt = new ReportDocument();
            cryRpt.Load(@"D:\Completing\WindowsFormsApplication1\payments11.rpt");
            crystalReportViewer1.ReportSource = cryRpt;
            crystalReportViewer1.Refresh();
}


While refreshing the crystal report on users/target machine it shows the above error. But reports are running on my machine. Error on target machine.
Posted
Updated 29-Oct-14 8:05am
v2
Comments
Richard Deeming 29-Oct-14 13:25pm    
Is SQL Server Express installed on the user's computer, and does it have a database called "trydb_1"?
Mohamed Shakir 29-Oct-14 20:53pm    
already installed SQL server, and database connected. And also intalled crystal runtime

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900