Skip to Content
0
Former Member
Jul 29, 2013 at 03:52 PM

Visual Studio 2012 C# and SQL 2008 SP2

35 Views

I'm running VS 2012 C# and SQL 2008 SP2. I'm getting an logon error in my Crystal Report Window Forms Viewer "Logon Failed". The report prompts the user to enter the logon information. Some reports work some don't. I'm using the following code to access the my database.

myReport.SetDatabaseLogon(ReportingUserId, ReportingPassword, ReportingServer, ReportingDB);

the error pops up. I've also tried:

Tables tables = reportName.Database.Tables;

foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)

{

TableLogOnInfo tableLogInInfo = table.LogOnInfo;

tableLogInInfo.ReportName = "Bill of Sale";
tableLogInInfo.ConnectionInfo.ServerName = ReportingServer;

tableLogInInfo.ConnectionInfo.DatabaseName = ReportingDB;

tableLogInInfo.ConnectionInfo.UserID = ReportingUserId;

tableLogInInfo.ConnectionInfo.Password = ReportingPassword;

table.ApplyLogOnInfo(tableLogInInfo);

}

Any help would be great!