Below is the code I have a question about. It is a simple setting of
tables with login information for my Web Form and response.writing out
the information:
crConnectionInfo = new ConnectionInfo();
crConnectionInfo.ServerName = "SSSQL\\STAGE";
crConnectionInfo.DatabaseName = "<DB>";
crConnectionInfo.UserID = "<USERNAME>";
crConnectionInfo.Password = "<PASSWORD>";
crDatabase = crReportDocument.Database;
crTables = crDatabase.Tables;
foreach(CrystalDecisions.CrystalReports.Engine.Tab le crTable in
crTables)
{
crTableLogonInfo = crTable.LogOnInfo;
crTableLogonInfo.ConnectionInfo = crConnectionInfo;
crTable.ApplyLogOnInfo(crTableLogonInfo);
Response.Write("Password: " + crConnectionInfo.Password);
Response.Write("TableName: " + crTable.LogOnInfo.TableName);
Response.Write("DatabaseName: " +
crTable.LogOnInfo.ConnectionInfo.ServerName);
Response.Write("UserID: " + crTable.LogOnInfo.ConnectionInfo.UserID);
Response.Write("Password: " +
crTable.LogOnInfo.ConnectionInfo.Password);
}
return;
When I run this code, I get the following info written out to the
screen:
Password: <PASSWORD>
TableName: NavStatUserCats
DatabaseName: SSSQL\STAGE
UserID: <USERNAME>
Password:
My question is: Why is the second response.write of "Password" blank?
The first .write shows the connection info property. Why doesn't it
get assigned to the crTable connection property during the foreach?
I've spent days trying to figure this one out. I even downloaded all
Hot Fixes and Patches for my 9.0 and VS.Net 2003 hoping for a
solution.
Any help would be mucho bien.
Thanks in advance...