title: Logon failed. Error in File xx.rpt: Unable to connect: incorrect log on parameters
body: <p>WPF Client application connect to a database in the server. Client pc does not have MS sql server installed. So i installed sql server native client latest version in the Client PC. But when i attempt to view the report i got the following error message. i double checked the database connection string in app.config,it contains correct logon information.</p>
  
  <pre><code>&lt;message&gt;Logon failed.Error in File EmployeeMealSummary {B32AECDC-7F60-4BD9-B2C9-F8153BF2CB5A}.rpt: Unable to connect: incorrect log on parameters.&lt;/message&gt;   
  &lt;source&gt;rptcontrollers.dll&lt;/source&gt;
  &lt;stackTrace&gt;at CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.SetTableLocation(ISCRTable CurTable, ISCRTable NewTable)
  </code></pre>
  
  <p>at CrystalDecisions.CrystalReports.Engine.Table.set_Location(String value)</p>
  
  <p>I have attached the code. Please help me to solve this issue.</p>
  
  <pre><code>private void SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument     reportDocument)
  {
      CrystalDecisions.Shared.TableLogOnInfo crTableLogonInfo;
      CrystalDecisions.CrystalReports.Engine.Tables crTables = _report.Database.Tables;
  
      foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
      {
          crTableLogonInfo = crTable.LogOnInfo;
          crTableLogonInfo.ConnectionInfo.LogonProperties.Clear();
          crTableLogonInfo.ConnectionInfo.Attributes.Collection.Clear();
          crTableLogonInfo.ConnectionInfo.DatabaseName = null;
          crTableLogonInfo.ConnectionInfo.ServerName = connectionInfo.ServerName;
          crTableLogonInfo.ConnectionInfo.UserID = connectionInfo.UserID;
          crTableLogonInfo.ConnectionInfo.Password = connectionInfo.Password;
          crTableLogonInfo.ConnectionInfo.DatabaseName = connectionInfo.DatabaseName;
          crTable.ApplyLogOnInfo(crTableLogonInfo);
  
          if (crTable.Name == "vEmployee" || crTable.Name == "TB_USER_DEPT" )
          {
              CenUtility.ErrorLog.CreateLog(new ArrayTypeMismatchException());
              crTable.Location = connectionInfo.DatabaseName + ".dbo." + crTable.Location; 
          }
          else
          {
              crTable.Location = connectionInfo.DatabaseName + ".CafDB." + crTable.Location;
          }
      }
  }
  </code></pre>