I have a bad feeling that I am not going to get any responses to this post but here goes. The folowing code was working perfectly just 1 month ago and never prompted for a password. In this example, I have a single report with one database table and no parameters. When I run this code, the form with the report viewer opens and pops up a small Database Login window with all of the fields populated. I click Ok and it says:
Login failed. Please try again.
I re-type the password and it still fails. I am 100% sure that the credentials are correct and If I run the report in Crystal Reports with the exact same credentials, the report runs as expected.
The application is running on one machine and the report resides in a folder on the SQL Server. This is happening with all reports that connect to a database. I have literaly spent the entire day researching this and have seen many, many posts like this but little or no suggestions and it there are any, they don't work.
ReportDocument reportDoc = new ReportDocument();
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.UserID = userName;
connectionInfo.Password = password;
connectionInfo.ServerName = odbcName;
connectionInfo.DatabaseName = databaseName;
foreach (Table table in reportDoc.Database.Tables)
TableLogOnInfo tableLogonInfo = table.LogOnInfo;
tableLogonInfo.ConnectionInfo = connectionInfo;
crystalReportViewer1.ReportSource = reportDoc;