Search code examples
c#databasecrystal-reportsdatabase-connection

How to solve error Database Vendor Code 17


i have windows application and i use crystal reports it works fine in my local machine but when deploy it i get this error Failed to open the connection Details:[Database Vendor Code 17] temp 21323asdasdfv-dfdsfc-dsfdsrxdfdf}.rpt Details :[Database Vendor Code 17] this is my code that run when report loaded

string LogonInfo = CONN.GetDataBaseLogon(); //Get Connection string from XML file
        string[] Log = LogonInfo.Split(',');
        SqlConnection Con = new SqlConnection(CONN.GetSqlConnectionString());
        string Command = "USE MainDB; EXEC [dbo].[GetAllSalaf] ;";
        DataSet DS = new DataSet();
        SqlDataAdapter SAD = new SqlDataAdapter(Command, Con);
        SAD.Fill(DS);
        NewReports.Reports.AllSalaf S = new Reports.AllSalaf();
        S.SetDataSource(DS);
       // Log[0] =User Id ,Log[1] password Log[2] Server name 
        S.SetDatabaseLogon(Log[0], Log[1], Log[2], "MainDB");
        crystalReportViewer1.ReportSource = S;
        crystalReportViewer1.Refresh();

Solution

  • Check:

    1. Crystal report Run time.
    2. If report Exists in you project deployment pc or server?