Crystal Reports .Net Blanking Password

T

TylerB

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.Table 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...
 
J

Jairo Nieto

Are you using a password type field to show the password?? thing is, because
of security reasons, :Net wont show any information on these types of text
boxes.
As a rule, you should never show password information on your pages, if you
need to change passwords, a separate module is better.

Hope this helps,

Jairo Nieto.
MCP
 
T

TylerB

All I'm doing is response.writing out the variables to the screen - no
textboxes or anything. I wouldn't think .Net would do that. Any
suggestions on my question? I have followed MANY tutorials on the
subject of adding passing db info to the Crystal Report, and it still
gives me the "logon failed" message.

Thanks again...
TylerB
 
T

TylerB

No textboxes are being used. I'm simply response.write(ing) the
variable information. Should be nothing wrong with doing that. So
why would my variable be blanking out then?
I've literally spent weeks trying to get this report to run. It has
no parameters. I've can run a blank template with a text field, and
all works fine. But as soon as I add a database field to it and set
connection info to that one table, it wigs out with the "logon failed"
message. I know it's probably something REALLY simple, but I'm just
not getting it.

Thanks again!
Tyler
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top